Class XMLClassDescriptorAdapter
java.lang.Object
org.exolab.castor.xml.Validator
org.exolab.castor.xml.util.XMLClassDescriptorImpl
org.exolab.castor.xml.util.XMLClassDescriptorAdapter
- All Implemented Interfaces:
NatureExtendable, PropertyHolder, ClassDescriptor, TypeValidator, ClassValidator, XMLClassDescriptor
An adapter class which can turn an ordinary ClassDescriptor into an
XMLClassDescriptor.
- Version:
- $Revision: 7436 $ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
- Author:
- Keith Visco
-
Field Summary
Fields inherited from class Validator
resourceBundle -
Constructor Summary
ConstructorsConstructorDescriptionXMLClassDescriptorAdapter(ClassDescriptor classDesc, String xmlName) Creates a new XMLClassDescriptorAdapter using the given ClassDescriptor.XMLClassDescriptorAdapter(ClassDescriptor classDesc, String xmlName, NodeType primitiveNodeType) Creates a new XMLClassDescriptorAdapter using the given ClassDescriptor. -
Method Summary
Methods inherited from class XMLClassDescriptorImpl
addFieldDescriptor, addNature, addSequenceElement, canAccept, checkDescriptorForCorrectOrderWithinSequence, contains, getAccessMode, getAttributeDescriptors, getContentDescriptor, getElementDescriptors, getExtends, getFieldDescriptor, getFields, getIdentity, getJavaClass, getNameSpacePrefix, getNameSpaceURI, getProperty, getSubstitutes, getValidator, getXMLName, hasContainerFields, hasNature, isChoice, isElementDefinition, removeFieldDescriptor, setCompositorAsAll, setCompositorAsChoice, setCompositorAsSequence, setElementDefinition, setExtends, setExtendsWithoutFlatten, setIdentity, setIntrospected, setJavaClass, setNameSpacePrefix, setNameSpaceURI, setProperty, setSubstitutes, setXMLName, sortDescriptors, toString, validate, validateModifier and TypeMethodDescriptionvoidaddFieldDescriptor(XMLFieldDescriptor descriptor) Adds the given XMLFieldDescriptor to the list of descriptors.voidAdds a specified nature.protected voidaddSequenceElement(XMLFieldDescriptor element) Adds a XMLFieldDescriptor instance to the internally maintained list of sequence elements.booleanReturns true if the given object, represented by this XMLClassDescriptor, can accept a value for the member associated with the given xml name and namespace.voidcheckDescriptorForCorrectOrderWithinSequence(XMLFieldDescriptor elementDescriptor, UnmarshalState parentState, String xmlName) Checks whether the given XMLFieldDescriptor is the one actually expected, given the natural order as defined by a sequence definitionbooleancontains(XMLFieldDescriptor descriptor) Returns true if the given XMLFieldDescriptor is contained within this XMLClassDescriptor.Returns the access mode specified for this class.Returns the set of XMLFieldDescriptors for all members that should be marshalled as XML attributes.Returns the XMLFieldDescriptor for the member that should be marshalled as text content.Returns the set of XMLFieldDescriptors for all members that should be marshalled as XML elements.Returns the class descriptor of the class extended by this class.getFieldDescriptor(String name, String namespace, NodeType nodeType) Returns the XML field descriptor matching the given xml name and nodeType.Returns a list of fields represented by this descriptor.Returns the identity field, null if this class has no identity.Class<?> Returns the Java class represented by this descriptor.Returns the namespace prefix to use when marshalling as XML.Returns the namespace URI used when marshalling and unmarshalling as XML.getProperty(String name) Get a property by its name.Returns a specific validator for the class described by this ClassDescriptor.Returns the XML Name for the Class being described.booleanReturns true if this XMLClassDescriptorImpl has any fields which are container objects.booleanChecks if a specified nature has been added.booleanisChoice()Indicates whether the XML artifact described by this descriptor is a invalid input: '<'xsd:choice>.booleanReturns true if XML schema definition of this Class is that of a global element or element with anonymous type definition.booleanremoveFieldDescriptor(XMLFieldDescriptor descriptor) Removes the given XMLFieldDescriptor from the list of descriptors.voidSets the compositor for the fields of the described class to be ALL.voidSets the compositor for the fields of the described class to be CHOICE.voidSets the compositor for the fields of the described class to be a Sequence.voidsetElementDefinition(boolean elementDefinition) Set elementDefinition to true to indicate Class XML schema definition is a global element or element with anonymous type.voidsetExtends(XMLClassDescriptor classDesc) Sets the XMLClassDescriptor that this descriptor inherits fromprotected voidsetExtendsWithoutFlatten(XMLClassDescriptor classDesc) voidsetIdentity(XMLFieldDescriptor fieldDesc) Sets the Identity FieldDescriptor, if the FieldDescriptor is not already a contained in this ClassDescriptor, it will be addedprotected voidsetIntrospected(boolean introspected) Sets a flag to indicate whether or not this XMLClassDescriptorImpl was created via introspectionvoidsetJavaClass(Class<?> type) Sets the Class type being described by this descriptor.voidsetNameSpacePrefix(String nsPrefix) Sets the namespace prefix used when marshalling as XML.voidsetNameSpaceURI(String nsURI) Sets the namespace URI used when marshalling and unmarshalling as XML.voidsetProperty(String name, Object value) Set a property specified by the name to the passed value.voidsetSubstitutes(List<String> substitutes) voidsetXMLName(String xmlName) Sets the XML name for the Class described by this XMLClassDescriptorvoidThis method is used to keep the set of descriptors in the proper sorted lists.toString()Returns the String representation of this XMLClassDescriptorvoidValidates the given Objectvoidvalidate(Object object, ValidationContext context) Validates the given objectMethods inherited from class Validator
checkUnresolvedIdrefs
-
Constructor Details
-
XMLClassDescriptorAdapter
public XMLClassDescriptorAdapter() -
XMLClassDescriptorAdapter
Creates a new XMLClassDescriptorAdapter using the given ClassDescriptor.- Parameters:
classDesc- the ClassDescriptor to "adapt"xmlName- the XML name for the class- Throws:
MappingException
-
XMLClassDescriptorAdapter
public XMLClassDescriptorAdapter(ClassDescriptor classDesc, String xmlName, NodeType primitiveNodeType) throws MappingException Creates a new XMLClassDescriptorAdapter using the given ClassDescriptor.- Parameters:
classDesc- the ClassDescriptor to "adapt"xmlName- the XML name for the classprimitiveNodeType- the NodeType to use for primitives- Throws:
MappingException
-