org.qtitools.qti.value
Class UriValue

java.lang.Object
  extended by org.qtitools.qti.value.SingleValue
      extended by org.qtitools.qti.value.UriValue
All Implemented Interfaces:
java.io.Serializable, Value

public class UriValue
extends SingleValue

Implementation of BaseType uri value.

Bound using the XML schema any URI type.

This class uses implementation of stadard java URI class.

Example values: 'http://www.example.com/', 'images/icon.gif', 'mailto:user@example.com'. Character ' is not part of uri value.

This class is not mutable and cannot contain NULL value.

Cardinality of this class is always single and BaseType is always uri.

Author:
Jiri Kajaba
See Also:
Cardinality, BaseType, URI, Serialized Form

Constructor Summary
UriValue(java.lang.String value)
          Constructs UriValue from given String representation.
UriValue(java.net.URI value)
          Constructs UriValue from given URI.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 BaseType getBaseType()
          Returns baseType of this value.
 int hashCode()
           
static java.net.URI parseUri(java.lang.String value)
          Parses the String argument as A URI.
 java.lang.String toString()
           
 java.net.URI uriValue()
          Returns the value of this UriValue as A URI.
 
Methods inherited from class org.qtitools.qti.value.SingleValue
getCardinality, isNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UriValue

public UriValue(java.net.URI value)
Constructs UriValue from given URI.

Parameters:
value - URI

UriValue

public UriValue(java.lang.String value)
         throws QTIParseException
Constructs UriValue from given String representation.

Parameters:
value - String representation of UriValue
Throws:
QTIParseException - if String representation of UriValue is not valid
Method Detail

getBaseType

public BaseType getBaseType()
Description copied from interface: Value
Returns baseType of this value.

If value is NULL or record cardinality returns null.

Returns:
baseType of this value

uriValue

public java.net.URI uriValue()
Returns the value of this UriValue as A URI.

Returns:
the value of this UriValue as A URI

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

parseUri

public static java.net.URI parseUri(java.lang.String value)
                             throws QTIParseException
Parses the String argument as A URI.

Parameters:
value - String representation of URI
Returns:
parsed URI
Throws:
QTIParseException - if String representation of URI is not valid


Copyright © 2009. All Rights Reserved.