org.exolab.castor.builder

Class XMLInfo

public class XMLInfo extends Object

A class for storing XML related information

Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:07:48 $

Author: Keith Visco

Field Summary
static shortATTRIBUTE_TYPE
Represents the attribute node type
static shortELEMENT_TYPE
Represents the element node type
static shortTEXT_TYPE
Represents the text node type
Constructor Summary
XMLInfo()
Creates a new XML Info
XMLInfo(short nodeType)
Creates a new XMLInfo with the given node type
XMLInfo(String name, short nodeType)
Creates a new XMLInfo with the given xml name and node type
Method Summary
StringgetNamespacePrefix()
Returns the namespace prefix of the object described by this XMLInfo
StringgetNamespaceURI()
Returns the namespace URI of the object described by this XMLInfo
StringgetNodeName()
Returns the XML name for the object described by this XMLInfo
shortgetNodeType()
Returns the node type for the object described by this XMLInfo
StringgetNodeTypeName()
Returns the string name of the nodeType, either "attribute", "element" or "text".
XSTypegetSchemaType()
Returns the XML Schema type for the described object
booleanisMultivalued()
Return whether or not the object described by this XMLInfo is multi-valued (appears more than once in the XML document)
booleanisRequired()
Return true if the XML object described by this XMLInfo must appear at least once in the XML document (or object model)
voidsetMultivalued(boolean multivalued)
Sets whether the XML object can appear more than once in the XML document
voidsetNamespacePrefix(String nsPrefix)
Sets the desired namespace prefix for this XMLInfo There is no guarantee that this prefix will be used.
voidsetNamespaceURI(String nsURI)
Sets the Namespace URI for this XMLInfo
voidsetNodeName(String name)
Sets the XML name of the object described by this XMLInfo.
voidsetNodeType(short nodeType)
Sets the nodeType for this XMLInfo
voidsetRequired(boolean required)
Sets whether or not the XML object must appear at least once
voidsetSchemaType(XSType xsType)
Sets the XML Schema type for this XMLInfo

Field Detail

ATTRIBUTE_TYPE

public static final short ATTRIBUTE_TYPE
Represents the attribute node type

ELEMENT_TYPE

public static final short ELEMENT_TYPE
Represents the element node type

TEXT_TYPE

public static final short TEXT_TYPE
Represents the text node type

Constructor Detail

XMLInfo

public XMLInfo()
Creates a new XML Info

XMLInfo

public XMLInfo(short nodeType)
Creates a new XMLInfo with the given node type

Parameters: nodeType the nodeType which this XMLInfo represents

XMLInfo

public XMLInfo(String name, short nodeType)
Creates a new XMLInfo with the given xml name and node type

Parameters: name the xml node name nodeType the nodeType which this XMLInfo represents

Method Detail

getNamespacePrefix

public String getNamespacePrefix()
Returns the namespace prefix of the object described by this XMLInfo

Returns: the namespace prefix of the object described by this XMLInfo

getNamespaceURI

public String getNamespaceURI()
Returns the namespace URI of the object described by this XMLInfo

Returns: the namespace URI of the object described by this XMLInfo

getNodeName

public String getNodeName()
Returns the XML name for the object described by this XMLInfo

Returns: the XML name for the object described by this XMLInfo, or null if no name has been set

getNodeType

public short getNodeType()
Returns the node type for the object described by this XMLInfo

Returns: the node type for the object described by this XMLInfo

getNodeTypeName

public String getNodeTypeName()
Returns the string name of the nodeType, either "attribute", "element" or "text".

Returns: the name of the node-type of the object described by this XMLInfo.

getSchemaType

public XSType getSchemaType()
Returns the XML Schema type for the described object

Returns: the XML Schema type

isMultivalued

public boolean isMultivalued()
Return whether or not the object described by this XMLInfo is multi-valued (appears more than once in the XML document)

Returns: true if this object can appear more than once

isRequired

public boolean isRequired()
Return true if the XML object described by this XMLInfo must appear at least once in the XML document (or object model)

Returns: true if the XML object must appear at least once

setMultivalued

public void setMultivalued(boolean multivalued)
Sets whether the XML object can appear more than once in the XML document

Parameters: multivalued the boolean indicating whether or not the object can appear more than once

setNamespacePrefix

public void setNamespacePrefix(String nsPrefix)
Sets the desired namespace prefix for this XMLInfo There is no guarantee that this prefix will be used.

Parameters: nsPrefix the desired namespace prefix

setNamespaceURI

public void setNamespaceURI(String nsURI)
Sets the Namespace URI for this XMLInfo

Parameters: nsURI the Namespace URIfor this XMLInfo

setNodeName

public void setNodeName(String name)
Sets the XML name of the object described by this XMLInfo.

Parameters: name the XML node name of the described object.

setNodeType

public void setNodeType(short nodeType)
Sets the nodeType for this XMLInfo

Parameters: nodeType the node type of the described object

setRequired

public void setRequired(boolean required)
Sets whether or not the XML object must appear at least once

Parameters: required the flag indicating whether or not this XML object is required

setSchemaType

public void setSchemaType(XSType xsType)
Sets the XML Schema type for this XMLInfo

Parameters: xsType the XML Schema type

Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com