NatureExtendable, PropertyHolder, ClassDescriptor, TypeValidator, ClassValidator, XMLClassDescriptorAutomaticNamingTypeDescriptor, BindingDescriptor, BindingTypeDescriptor, BindXmlAutoNamingTypeDescriptor, BindXmlDescriptor, BindXmlNodeTypeDescriptor, CacheTypeMappingDescriptor, ClassChoiceDescriptor, ClassMappingAccessTypeDescriptor, ClassMappingDescriptor, ClassTypeDescriptor, ComponentBindingTypeChoiceDescriptor, ComponentBindingTypeDescriptor, ContainerDescriptor, ContentMemberTypeDescriptor, EnumBindingTypeDescriptor, EnumClassNameDescriptor, EnumerationDescriptor, EnumMemberDescriptor, ExcludeDescriptor, ExcludesDescriptor, FieldHandlerDefDescriptor, FieldMappingCollectionTypeDescriptor, FieldMappingDescriptor, FieldTypeCollectionTypeDescriptor, FieldTypeDescriptor, FieldTypeVisibilityTypeDescriptor, ForcesDescriptor, IncludeDescriptor, IncludeTypeDescriptor, InterfaceDescriptor, IntrospectedXMLClassDescriptor, KeyGeneratorDefDescriptor, LdapDescriptor, ManyToManyDescriptor, MappingRootDescriptor, MapToDescriptor, NamedNativeQueryDescriptor, NamedQueryDescriptor, NamingTypeDescriptor, NamingXMLTypeDescriptor, PackageTypeChoiceDescriptor, PackageTypeDescriptor, ParamDescriptor, PkTypeDescriptor, PropertyTypeDescriptor, QueryHintDescriptor, ReadonlyDirtyTypeDescriptor, SqlDescriptor, SqlDirtyTypeDescriptor, TableAccessModeTypeDescriptor, TableDescriptor, VisibilityTypeDescriptor, XMLClassDescriptorAdapterpublic class XMLClassDescriptorImpl extends Validator implements XMLClassDescriptor
resourceBundle| Modifier | Constructor | Description |
|---|---|---|
protected |
XMLClassDescriptorImpl() |
Protected constructor used by this class, and subclasses only
|
|
XMLClassDescriptorImpl(java.lang.Class<?> type) |
Creates an XMLClassDescriptor class used by the Marshalling Framework.
|
|
XMLClassDescriptorImpl(java.lang.Class<?> type,
java.lang.String xmlName) |
Creates an XMLClassDescriptor class used by the Marshalling Framework.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addFieldDescriptor(XMLFieldDescriptor descriptor) |
Adds the given XMLFieldDescriptor to the list of descriptors.
|
void |
addNature(java.lang.String nature) |
Adds a specified nature.
|
protected void |
addSequenceElement(XMLFieldDescriptor element) |
Adds a XMLFieldDescriptor instance to the internally maintained
list of sequence elements.
|
boolean |
canAccept(java.lang.String name,
java.lang.String namespace,
java.lang.Object object) |
Returns true if the given object, represented by this
XMLClassDescriptor, can accept a value for the member
associated with the given xml name and namespace.
|
void |
checkDescriptorForCorrectOrderWithinSequence(XMLFieldDescriptor elementDescriptor,
UnmarshalState parentState,
java.lang.String xmlName) |
Checks whether the given XMLFieldDescriptor is the one actually expected,
given the natural order as defined by a sequence definition
|
boolean |
contains(XMLFieldDescriptor descriptor) |
Returns true if the given XMLFieldDescriptor is contained
within this XMLClassDescriptor.
|
AccessMode |
getAccessMode() |
Returns the access mode specified for this class.
|
XMLFieldDescriptor[] |
getAttributeDescriptors() |
Returns the set of XMLFieldDescriptors for all members that should be
marshalled as XML attributes.
|
XMLFieldDescriptor |
getContentDescriptor() |
Returns the XMLFieldDescriptor for the member that should be marshalled
as text content.
|
XMLFieldDescriptor[] |
getElementDescriptors() |
Returns the set of XMLFieldDescriptors for all members
that should be marshalled as XML elements.
|
ClassDescriptor |
getExtends() |
Returns the class descriptor of the class extended by this class.
|
XMLFieldDescriptor |
getFieldDescriptor(java.lang.String name,
java.lang.String namespace,
NodeType nodeType) |
Returns the XML field descriptor matching the given xml name and
nodeType.
|
FieldDescriptor[] |
getFields() |
Returns a list of fields represented by this descriptor.
|
FieldDescriptor |
getIdentity() |
Returns the identity field, null if this class has no identity.
|
java.lang.Class<?> |
getJavaClass() |
Returns the Java class represented by this descriptor.
|
java.lang.String |
getNameSpacePrefix() |
Returns the namespace prefix to use when marshalling as XML.
|
java.lang.String |
getNameSpaceURI() |
Returns the namespace URI used when marshalling and unmarshalling as XML.
|
java.lang.Object |
getProperty(java.lang.String name) |
Get a property by its name.
|
java.util.List<java.lang.String> |
getSubstitutes() |
|
TypeValidator |
getValidator() |
Returns a specific validator for the class described by
this ClassDescriptor.
|
java.lang.String |
getXMLName() |
Returns the XML Name for the Class being described.
|
boolean |
hasContainerFields() |
Returns true if this XMLClassDescriptorImpl has any fields which are
container objects.
|
boolean |
hasNature(java.lang.String nature) |
Checks if a specified nature has been added.
|
boolean |
isChoice() |
Indicates whether the XML artifact described by this descriptor is a
|
(package private) static boolean |
isDefaultPrimitiveValue(java.lang.Object value) |
Checks to see if the given Object is a java primitive
(does not check for primitive wrappers) and has a
value that is equal to the default value for that
primitive.
|
boolean |
isElementDefinition() |
Returns true if XML schema definition of this Class is that of a global
element or element with anonymous type definition.
|
(package private) static boolean |
isPrimitive(java.lang.Class<?> type) |
Returns true if the given class should be treated as a primitive
type.
|
boolean |
removeFieldDescriptor(XMLFieldDescriptor descriptor) |
Removes the given XMLFieldDescriptor from the list of descriptors.
|
void |
setCompositorAsAll() |
Sets the compositor for the fields of the described
class to be ALL.
|
void |
setCompositorAsChoice() |
Sets the compositor for the fields of the described
class to be CHOICE.
|
void |
setCompositorAsSequence() |
Sets the compositor for the fields of the described
class to be a Sequence.
|
void |
setElementDefinition(boolean elementDefinition) |
Set elementDefinition to true to indicate Class XML schema
definition is a global element or element with anonymous type.
|
void |
setExtends(XMLClassDescriptor classDesc) |
Sets the XMLClassDescriptor that this descriptor inherits from
|
protected void |
setExtendsWithoutFlatten(XMLClassDescriptor classDesc) |
|
void |
setIdentity(XMLFieldDescriptor fieldDesc) |
Sets the Identity FieldDescriptor, if the FieldDescriptor is
not already a contained in this ClassDescriptor, it will be
added
|
protected void |
setIntrospected(boolean introspected) |
Sets a flag to indicate whether or not this XMLClassDescriptorImpl
was created via introspection
|
void |
setJavaClass(java.lang.Class<?> type) |
Sets the Class type being described by this descriptor.
|
void |
setNameSpacePrefix(java.lang.String nsPrefix) |
Sets the namespace prefix used when marshalling as XML.
|
void |
setNameSpaceURI(java.lang.String nsURI) |
Sets the namespace URI used when marshalling and unmarshalling as XML.
|
void |
setProperty(java.lang.String name,
java.lang.Object value) |
Set a property specified by the name to the passed value.
|
void |
setSubstitutes(java.util.List<java.lang.String> substitutes) |
|
void |
setXMLName(java.lang.String xmlName) |
Sets the XML name for the Class described by this XMLClassDescriptor
|
void |
sortDescriptors() |
This method is used to keep the set of descriptors in the proper
sorted lists.
|
java.lang.String |
toString() |
Returns the String representation of this XMLClassDescriptor
|
void |
validate(java.lang.Object object) |
Validates the given Object
|
void |
validate(java.lang.Object object,
ValidationContext context) |
Validates the given object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckUnresolvedIdrefspublic XMLClassDescriptorImpl(java.lang.Class<?> type)
type - the Class type with which this ClassDescriptor describes.public XMLClassDescriptorImpl(java.lang.Class<?> type,
java.lang.String xmlName)
type - the Class type with which this ClassDescriptor describes.protected XMLClassDescriptorImpl()
public void addFieldDescriptor(XMLFieldDescriptor descriptor)
descriptor - the XMLFieldDescriptor to addpublic boolean contains(XMLFieldDescriptor descriptor)
public XMLFieldDescriptor[] getAttributeDescriptors()
getAttributeDescriptors in interface XMLClassDescriptorpublic XMLFieldDescriptor getContentDescriptor()
getContentDescriptor in interface XMLClassDescriptorpublic XMLFieldDescriptor[] getElementDescriptors()
getElementDescriptors in interface XMLClassDescriptorpublic void checkDescriptorForCorrectOrderWithinSequence(XMLFieldDescriptor elementDescriptor, UnmarshalState parentState, java.lang.String xmlName) throws ValidationException
checkDescriptorForCorrectOrderWithinSequence in interface XMLClassDescriptorelementDescriptor - The XML field descriptor to be checkedxmlName - TODOValidationException - If the descriptor is not the one expectedpublic XMLFieldDescriptor getFieldDescriptor(java.lang.String name, java.lang.String namespace, NodeType nodeType)
If an field is matched in one of the container field, it will return the container field that contain the field named 'name'
getFieldDescriptor in interface XMLClassDescriptorname - the xml name to match againstnodeType - the NodeType to match against, or null if the node type
is not known.public java.lang.String getNameSpacePrefix()
XMLClassDescriptorgetNameSpacePrefix in interface XMLClassDescriptorpublic java.lang.String getNameSpaceURI()
XMLClassDescriptorgetNameSpaceURI in interface XMLClassDescriptorpublic TypeValidator getValidator()
getValidator in interface XMLClassDescriptorpublic java.lang.String getXMLName()
getXMLName in interface XMLClassDescriptorpublic boolean isElementDefinition()
public boolean hasContainerFields()
public boolean removeFieldDescriptor(XMLFieldDescriptor descriptor)
descriptor - the XMLFieldDescriptor to removepublic void setCompositorAsAll()
public void setCompositorAsChoice()
public void setCompositorAsSequence()
public void setExtends(XMLClassDescriptor classDesc)
classDesc - the XMLClassDescriptor that this descriptor
extendspublic void setIdentity(XMLFieldDescriptor fieldDesc)
public void setNameSpacePrefix(java.lang.String nsPrefix)
nsPrefix - the namespace prefix used when marshalling
the "described" objectpublic void setNameSpaceURI(java.lang.String nsURI)
nsURI - the namespace URI used when marshalling and
unmarshalling the "described" Object.public void setXMLName(java.lang.String xmlName)
xmlName - the XML name for the Class described by this
XMLClassDescriptorpublic void setElementDefinition(boolean elementDefinition)
elementDefinition - flag to indicate XML definition is
global element or element with anonymous typepublic void sortDescriptors()
public java.lang.String toString()
toString in class java.lang.Objectpublic void validate(java.lang.Object object)
throws ValidationException
validate in class Validatorobject - the Object to validateValidationException - if validation fails.public void validate(java.lang.Object object,
ValidationContext context)
throws ValidationException
validate in interface ClassValidatorvalidate in interface TypeValidatorvalidate in class Validatorobject - the Object to validatecontext - the ValidationContextValidationException - if validation fails.public java.lang.Class<?> getJavaClass()
getJavaClass in interface ClassDescriptorpublic FieldDescriptor[] getFields()
getFields in interface ClassDescriptorpublic ClassDescriptor getExtends()
getExtends in interface ClassDescriptorpublic FieldDescriptor getIdentity()
getIdentity in interface ClassDescriptorpublic AccessMode getAccessMode()
public boolean canAccept(java.lang.String name,
java.lang.String namespace,
java.lang.Object object)
XMLClassDescriptorReturns true if the given object, represented by this XMLClassDescriptor, can accept a value for the member associated with the given xml name and namespace.
An XMLClassDescriptor can accept a value for a field if it contains a descriptor that matches the given xml name and namespace and if the given object can hold this field (i.e a value is not already set for this field).
canAccept in interface XMLClassDescriptorname - the xml name of the field to checknamespace - the namespace uriobject - the object instance represented by this XMLCLassDescriptorXMLClassDescriptor.canAccept(java.lang.String,
java.lang.String, java.lang.Object)static boolean isPrimitive(java.lang.Class<?> type)
static boolean isDefaultPrimitiveValue(java.lang.Object value)
public void setJavaClass(java.lang.Class<?> type)
type - the Class type being describedprotected void setExtendsWithoutFlatten(XMLClassDescriptor classDesc)
protected void setIntrospected(boolean introspected)
introspected - a boolean, when true indicated that this
XMLClassDescriptor was created via introspectionprotected void addSequenceElement(XMLFieldDescriptor element)
element - An XMLFieldDescriptor instance for an element definition.public java.util.List<java.lang.String> getSubstitutes()
public void setSubstitutes(java.util.List<java.lang.String> substitutes)
public boolean isChoice()
XMLClassDescriptorisChoice in interface XMLClassDescriptorpublic java.lang.Object getProperty(java.lang.String name)
PropertyHoldergetProperty in interface PropertyHoldername - of the propertypublic void setProperty(java.lang.String name,
java.lang.Object value)
PropertyHoldersetProperty in interface PropertyHoldername - of the propertyvalue - of the propertypublic void addNature(java.lang.String nature)
NatureExtendableaddNature in interface NatureExtendablenature - ID of the Naturepublic boolean hasNature(java.lang.String nature)
NatureExtendablehasNature in interface NatureExtendablenature - ID of the NatureIntalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com