Class XMLInfoNature
java.lang.Object
org.castor.core.nature.BaseNature
org.exolab.castor.builder.info.nature.XMLInfoNature
- All Implemented Interfaces:
Nature
A XML specific view of a
PropertyHolder
, which can be a ClassInfo
or a
FieldInfo
. Property based implementation.- Since:
- 1.2.1
- Author:
- Lukas Lang
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theGroupInfo
for this XML nature.getId()
Implementation returns the fully qualified class name.Returns the namespace prefix of the object described by this XMLInfo.Returns the namespace URI of the object described by this XMLInfo.Returns the XML name for the object described by this XMLInfo.Returns the node type for the object described by this XMLInfo.Returns the string name of the nodeType, either "attribute", "element" or "text".Returns the XML Schema type for the described object.Returns the possible substitution groups.boolean
isChoice()
Returns true if the compositor of this GroupInfo is a choice.boolean
Returns true if this ClassInfo describes a container class.boolean
Returns true if XSD is global element or element with anonymous type or false if property is not set.boolean
Returns whether or not the object described by this XMLInfo is multi-valued (appears more than once in the XML document).boolean
Return true if the XML object described by this XMLInfo must appear at least once in the XML document (or object model).boolean
Returns true if the compositor of this GroupInfo is a sequence.void
setContainer
(boolean isContainer) Sets whether or not this ClassInfo describes a container class.void
setElementDefinition
(boolean elementDef) Sets whether or not XSD is element or not.void
setGroupInfo
(GroupInfo groupInfo) Sets theGroupInfo
for this XML nature.void
setMultivalued
(boolean multivalued) Sets whether the XML object can appear more than once in the XML document.void
setNamespacePrefix
(String nsPrefix) Sets the desired namespace prefix for this XMLInfo There is no guarantee that this prefix will be used.void
setNamespaceURI
(String nsURI) Sets the Namespace URI for this XMLInfo.void
setNodeName
(String name) Sets the XML name of the object described by this XMLInfo.void
setNodeType
(NodeType nodeType) Sets the nodeType for this XMLInfo.void
setRequired
(boolean required) Sets whether or not the XML object must appear at least once.void
setSchemaType
(XSType xsType) Sets the XML Schema type for this XMLInfo.void
setSubstitutionGroups
(List<String> substitutionGroups) Sets the possible substitution groups.Methods inherited from class org.castor.core.nature.BaseNature
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty
-
Constructor Details
-
XMLInfoNature
Constructor taking a PropertyHolder.- Parameters:
holder
- in focus.
-
-
Method Details
-
getId
Implementation returns the fully qualified class name.- Returns:
- the Nature id.
- See Also:
-
org.exolab.castor.builder.info.nature.Nature#getId()
-
getNamespacePrefix
Returns the namespace prefix of the object described by this XMLInfo.- Returns:
- the namespace prefix of the object described by this XMLInfo
-
getNamespaceURI
Returns the namespace URI of the object described by this XMLInfo.- Returns:
- the namespace URI of the object described by this XMLInfo
-
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
Returns the node type for the object described by this XMLInfo.XMLInfo.ELEMENT_TYPE
if property is not set.- Returns:
- the node type for the object described by this XMLInfo
-
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
Returns the XML Schema type for the described object.- Returns:
- the XML Schema type.
-
isElementDefinition
public boolean isElementDefinition()Returns true if XSD is global element or element with anonymous type or false if property is not set.- Returns:
- true if xsd is element, false if not or null.
-
isMultivalued
public boolean isMultivalued()Returns whether or not the object described by this XMLInfo is multi-valued (appears more than once in the XML document). Returns false if the property was not set.- Returns:
- true if this object can appear more than once, false if not or not set.
-
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 false if the property was not set.- Returns:
- true if the XML object must appear at least once, false if not or not set.
-
setElementDefinition
public void setElementDefinition(boolean elementDef) Sets whether or not XSD is element or not.- Parameters:
elementDef
- The flag indicating whether or not XSD is global element, element with anonymous type or not.
-
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
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
Sets the Namespace URI for this XMLInfo.- Parameters:
nsURI
- the Namespace URI for this XMLInfo
-
setNodeName
Sets the XML name of the object described by this XMLInfo.- Parameters:
name
- the XML node name of the described object.
-
setNodeType
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
Sets the XML Schema type for this XMLInfo.- Parameters:
xsType
- the XML Schema type
-
getSubstitutionGroups
Returns the possible substitution groups.- Returns:
- the possible substitution groups.
-
setSubstitutionGroups
Sets the possible substitution groups.- Parameters:
substitutionGroups
- Possible substitution groups.
-
isContainer
public boolean isContainer()Returns true if this ClassInfo describes a container class. A container class is a class which should not be marshalled as XML, but whose members should be.- Returns:
- true if this ClassInfo describes a container class.
-
setContainer
public void setContainer(boolean isContainer) Sets whether or not this ClassInfo describes a container class. A container class is a class which should not be marshalled as XML, but whose members should be. By default this is false.- Parameters:
isContainer
- the boolean value when true indicates this class should be a container class.
-
getGroupInfo
Returns theGroupInfo
for this XML nature.- Returns:
- the
GroupInfo
instance.
-
setGroupInfo
Sets theGroupInfo
for this XML nature.- Parameters:
groupInfo
- theGroupInfo
instance.
-
isChoice
public boolean isChoice()Returns true if the compositor of this GroupInfo is a choice.- Returns:
- true if the compositor of this GroupInfo is a choice
-
isSequence
public boolean isSequence()Returns true if the compositor of this GroupInfo is a sequence.- Returns:
- true if the compositor of this GroupInfo is a sequence
-