Package org.exolab.castor.xml
Class NodeType
java.lang.Object
org.exolab.castor.xml.NodeType
The 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
FieldsModifier and TypeFieldDescriptionstatic final NodeType
Attribute node type (attribute).static final short
The attribute type.static final NodeType
Element node type (element).static final short
The element type.static final NodeType
Namespace node type (namespace).static final short
The namespace node type.static final NodeType
Content node type (text).static final short
The text type. -
Method Summary
-
Field Details
-
ATTRIBUTE
public static final short ATTRIBUTEThe attribute type.- See Also:
-
ELEMENT
public static final short ELEMENTThe element type.- See Also:
-
NAMESPACE
public static final short NAMESPACEThe namespace node type.- See Also:
-
TEXT
public static final short TEXTThe text type.- See Also:
-
Attribute
Attribute node type (attribute). This field will appear in the XML document as an element's attribute. -
Element
Element node type (element). This field will appear in the XML document as a contained element. -
Namespace
Namespace node type (namespace). This field will appear in the XML document as a namespace declaration. -
Text
Content node type (text). This field will appear in the XML document as the element text content.
-
-
Method Details
-
getNodeType
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
Returns the name of this NodeType.
-