|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.Validator
org.exolab.castor.xml.util.XMLClassDescriptorImpl
An implementation of XMLClassDescriptor
Constructor Summary | |
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. |
Method Summary | |
void |
addFieldDescriptor(XMLFieldDescriptor descriptor)
Adds the given XMLFieldDescriptor to the list of descriptors. |
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,
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()
|
java.lang.String |
getNameSpaceURI()
|
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. |
void |
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 |
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 |
protected 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 |
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 |
protected java.lang.String |
toXMLName(java.lang.String className)
|
void |
validate(java.lang.Object object)
Validates the given Object |
void |
validate(java.lang.Object object,
ClassDescriptorResolver resolver)
Validates the given object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public 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()
Method Detail |
public void addFieldDescriptor(XMLFieldDescriptor descriptor)
descriptor
- the XMLFieldDescriptor to addpublic XMLFieldDescriptor[] getAttributeDescriptors()
getAttributeDescriptors
in interface XMLClassDescriptor
public XMLFieldDescriptor getContentDescriptor()
getContentDescriptor
in interface XMLClassDescriptor
public XMLFieldDescriptor[] getElementDescriptors()
getElementDescriptors
in interface XMLClassDescriptor
public XMLFieldDescriptor getFieldDescriptor(java.lang.String name, NodeType nodeType)
getFieldDescriptor
in interface XMLClassDescriptor
name
- the xml name to match against
public java.lang.String getNameSpacePrefix()
getNameSpacePrefix
in interface XMLClassDescriptor
public java.lang.String getNameSpaceURI()
getNameSpaceURI
in interface XMLClassDescriptor
public TypeValidator getValidator()
getValidator
in interface XMLClassDescriptor
public java.lang.String getXMLName()
getXMLName
in interface XMLClassDescriptor
public void 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 sortDescriptors()
public java.lang.String toString()
public void validate(java.lang.Object object) throws ValidationException
validate
in interface ClassValidator
validate
in class Validator
object
- the Object to validate
ValidationException
public void validate(java.lang.Object object, ClassDescriptorResolver resolver) throws ValidationException
validate
in interface ClassValidator
validate
in class Validator
object
- the Object to validateresolver
- the ClassDescriptorResolver to use when
loading ClassDescriptors
ValidationException
public java.lang.Class getJavaClass()
getJavaClass
in interface ClassDescriptor
public FieldDescriptor[] getFields()
getFields
in interface ClassDescriptor
public ClassDescriptor getExtends()
getExtends
in interface ClassDescriptor
public FieldDescriptor getIdentity()
getIdentity
in interface ClassDescriptor
public AccessMode getAccessMode()
getAccessMode
in interface ClassDescriptor
protected void setJavaClass(java.lang.Class type)
protected void setExtendsWithoutFlatten(XMLClassDescriptor classDesc)
protected void setIntrospected(boolean introspected)
introspected
- a boolean, when true indicated that this
XMLClassDescriptor was created via introspectionprotected java.lang.String toXMLName(java.lang.String className)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |