Class BaseDescriptor
java.lang.Object
org.exolab.castor.xml.descriptors.BaseDescriptor
- All Implemented Interfaces:
NatureExtendable, PropertyHolder, ClassDescriptor, XMLClassDescriptor
- Direct Known Subclasses:
DateClassDescriptor, ListClassDescriptor, LocaleDescriptor, RootArrayDescriptor, SQLDateClassDescriptor, SQLTimeClassDescriptor, SQLTimestampClassDescriptor, StringClassDescriptor, VectorClassDescriptor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a specified nature.booleanReturns true if the given object represented by this XMLClassDescriptor can accept a member whose name is given.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 definitiongetProperty(String name) Get a property by its name.booleanChecks if a specified nature has been added.booleanisChoice()Indicates whether the XML artifact described by this descriptor is a invalid input: '<'xsd:choice>.voidsetProperty(String name, Object value) Set a property specified by the name to the passed value.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ClassDescriptor
getExtends, getFields, getIdentity, getJavaClassModifier and TypeMethodDescriptionReturns the class descriptor of the class extended by this class.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.Methods inherited from interface XMLClassDescriptor
getAttributeDescriptors, getContentDescriptor, getElementDescriptors, getFieldDescriptor, getNameSpacePrefix, getNameSpaceURI, getValidator, getXMLNameModifier and TypeMethodDescriptionReturns 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.getFieldDescriptor(String name, String namespace, NodeType nodeType) Returns the XML field descriptor matching the given xml name, namespace, and nodeType.Returns the namespace prefix to use when marshalling as XML.Returns the namespace URI used when marshalling and unmarshalling as XML.Returns a specific validator for the class described by this ClassDescriptor.Returns the XML Name for the Class being described.
-
Constructor Details
-
BaseDescriptor
public BaseDescriptor()
-
-
Method Details
-
canAccept
Returns true if the given object represented by this XMLClassDescriptor can accept a member whose name is given. An XMLClassDescriptor can accept a field if it contains a descriptor that matches the given name and if the given object can hold this field (i.e a value is not already set for this field).This is mainly used for container object (that can contain other objects), in this particular case the implementation returns false.
- Specified by:
canAcceptin interfaceXMLClassDescriptor- Parameters:
name- the name of the field to checknamespace- the namespace of the element. This may be null. Note: A null namespace is not the same as the default namespace unless the default namespace is also null.object- the object represented by this XMLCLassDescriptor- Returns:
- true if the given object represented by this XMLClassDescriptor can accept a member whose name is given.
-
checkDescriptorForCorrectOrderWithinSequence
public void checkDescriptorForCorrectOrderWithinSequence(XMLFieldDescriptor elementDescriptor, UnmarshalState parentState, String xmlName) throws ValidationException Checks whether the given XMLFieldDescriptor is the one actually expected, given the natural order as defined by a sequence definition- Specified by:
checkDescriptorForCorrectOrderWithinSequencein interfaceXMLClassDescriptor- Parameters:
elementDescriptor- The XML field descriptor to be checkedxmlName- TODO- Throws:
ValidationException- If the descriptor is not the one expected
-
isChoice
public boolean isChoice()Indicates whether the XML artifact described by this descriptor is a invalid input: '<'xsd:choice>.- Specified by:
isChoicein interfaceXMLClassDescriptor- Returns:
- True if the artifact described is a choice.
- See Also:
-
getProperty
Description copied from interface:PropertyHolderGet a property by its name.- Specified by:
getPropertyin interfacePropertyHolder- Parameters:
name- of the property- Returns:
- value of the property
-
setProperty
Description copied from interface:PropertyHolderSet a property specified by the name to the passed value.- Specified by:
setPropertyin interfacePropertyHolder- Parameters:
name- of the propertyvalue- of the property
-
addNature
Description copied from interface:NatureExtendableAdds a specified nature.- Specified by:
addNaturein interfaceNatureExtendable- Parameters:
nature- ID of the Nature
-
hasNature
Description copied from interface:NatureExtendableChecks if a specified nature has been added.- Specified by:
hasNaturein interfaceNatureExtendable- Parameters:
nature- ID of the Nature- Returns:
- true if the Nature ID was added.
-