org.deegree.commons.tom.primitive
Class PrimitiveValue

java.lang.Object
  extended by org.deegree.commons.tom.primitive.PrimitiveValue
All Implemented Interfaces:
java.lang.Comparable<PrimitiveValue>, TypedObjectNode

public class PrimitiveValue
extends java.lang.Object
implements TypedObjectNode, java.lang.Comparable<PrimitiveValue>

TypedObjectNode that represents a typed primitive value, e.g. an XML text node or an XML attribute value with type information.

Version:
$Revision: 27849 $, $Date: 2010-11-08 19:43:49 +0100 (Mo, 08. Nov 2010) $
Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
PrimitiveType

Constructor Summary
PrimitiveValue(java.lang.Object value)
           
PrimitiveValue(java.lang.Object value, PrimitiveType type)
           
PrimitiveValue(java.lang.String value, PrimitiveType type)
           
PrimitiveValue(java.lang.String value, org.apache.xerces.xs.XSSimpleTypeDefinition xsdType)
           
 
Method Summary
 int compareTo(PrimitiveValue o)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getAsText()
          Returns the text representation of the value.
 PrimitiveType getType()
          Returns the type of the value.
 java.lang.Object getValue()
          Returns the canonical object representation of the value.
 org.apache.xerces.xs.XSSimpleTypeDefinition getXSType()
          Returns the XML schema type for the value.
 int hashCode()
           
static Pair<java.lang.Object,java.lang.Object> makeComparable(java.lang.Object value1, java.lang.Object value2)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrimitiveValue

public PrimitiveValue(java.lang.Object value,
                      PrimitiveType type)
               throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

PrimitiveValue

public PrimitiveValue(java.lang.String value,
                      PrimitiveType type)
               throws java.lang.IllegalArgumentException
Parameters:
value -
type -
Throws:
java.lang.IllegalArgumentException

PrimitiveValue

public PrimitiveValue(java.lang.String value,
                      org.apache.xerces.xs.XSSimpleTypeDefinition xsdType)
               throws java.lang.IllegalArgumentException
Parameters:
value -
xsdType -
Throws:
java.lang.IllegalArgumentException

PrimitiveValue

public PrimitiveValue(java.lang.Object value)
               throws java.lang.IllegalArgumentException
Parameters:
value -
Throws:
java.lang.IllegalArgumentException
Method Detail

getValue

public java.lang.Object getValue()
Returns the canonical object representation of the value.

Returns:
the canonical object representation of the value, never null

getAsText

public java.lang.String getAsText()
Returns the text representation of the value.

Returns:
the text representation of the value, never null

getType

public PrimitiveType getType()
Returns the type of the value.

Returns:
the type of the value, never null

getXSType

public org.apache.xerces.xs.XSSimpleTypeDefinition getXSType()
Returns the XML schema type for the value.

Returns:
the XML schema type for the value, can be null

compareTo

public int compareTo(PrimitiveValue o)
Specified by:
compareTo in interface java.lang.Comparable<PrimitiveValue>

equals

public boolean equals(java.lang.Object o)
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

makeComparable

public static Pair<java.lang.Object,java.lang.Object> makeComparable(java.lang.Object value1,
                                                                     java.lang.Object value2)
                                                              throws java.lang.IllegalArgumentException
Parameters:
value1 -
value2 -
Returns:
should be a ComparablePair now that we have it...
Throws:
java.lang.IllegalArgumentException


Copyright © 2011. All Rights Reserved.