Package org.exolab.castor.xml
Class NodeType
- java.lang.Object
-
- org.exolab.castor.xml.NodeType
-
public final class NodeType extends java.lang.ObjectThe possible node types for an XML field. A field can be represented as an attribute, an element or text content. The default is attribute. This class is essentially a typesafe enumeration and the instances are immutable.- Version:
- $Revision: 6761 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
- Author:
- Assaf Arkin, Keith Visco
-
-
Field Summary
Fields Modifier and Type Field Description static NodeTypeAttributeAttribute node type (attribute).static shortATTRIBUTEThe attribute type.static NodeTypeElementElement node type (element).static shortELEMENTThe element type.static NodeTypeNamespaceNamespace node type (namespace).static shortNAMESPACEThe namespace node type.static NodeTypeTextContent node type (text).static shortTEXTThe text type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeTypegetNodeType(java.lang.String nodeType)Returns the node type from the name.shortgetType()Returns the type of this NodeType.java.lang.StringtoString()Returns the name of this NodeType.
-
-
-
Field Detail
-
ATTRIBUTE
public static final short ATTRIBUTE
The attribute type.- See Also:
- Constant Field Values
-
ELEMENT
public static final short ELEMENT
The element type.- See Also:
- Constant Field Values
-
NAMESPACE
public static final short NAMESPACE
The namespace node type.- See Also:
- Constant Field Values
-
TEXT
public static final short TEXT
The text type.- See Also:
- Constant Field Values
-
Attribute
public static final NodeType Attribute
Attribute node type (attribute). This field will appear in the XML document as an element's attribute.
-
Element
public static final NodeType Element
Element node type (element). This field will appear in the XML document as a contained element.
-
Namespace
public static final NodeType Namespace
Namespace node type (namespace). This field will appear in the XML document as a namespace declaration.
-
Text
public static final NodeType Text
Content node type (text). This field will appear in the XML document as the element text content.
-
-
Method Detail
-
getNodeType
public static NodeType getNodeType(java.lang.String nodeType)
Returns the node type from the name. If nodeType is null, return the default node type (Attribute). Otherwise returns the named node type mode.- Parameters:
nodeType- The node type name- Returns:
- The node type
-
getType
public short getType()
Returns the type of this NodeType.- Returns:
- the type of this NodeType.
-
toString
public java.lang.String toString()
Returns the name of this NodeType.- Overrides:
toStringin classjava.lang.Object- Returns:
- the name of this NodeType.
-
-