|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharness.BaseHarnessDescriptor
public abstract class BaseHarnessDescriptor
Base class for all descriptor classes of the JDO test harness.
Field Summary | |
---|---|
protected XMLFieldDescriptor[] |
_attributeDescriptors
Set of XMLFieldDescriptor s for all members that should be marshalled
as XML attributes. |
protected XMLFieldDescriptorImpl |
_contentDescriptor
XMLFieldDescriptor for the member that should be marshalled as text content. |
protected XMLFieldDescriptor[] |
_elementDescriptors
Set of XMLFieldDescriptor s for all members that should be marshalled
as XML elements. |
protected java.lang.String |
_nsPrefix
Namespace prefix. |
protected java.lang.String |
_nsURI
Namespace URI. |
protected java.lang.String |
_xmlName
XML name for the class being described. |
Constructor Summary | |
---|---|
BaseHarnessDescriptor()
|
Method Summary | |
---|---|
void |
addNature(java.lang.String nature)
Adds a specified nature. |
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 member whose name is given. |
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 |
AccessMode |
getAccessMode()
Returns the current AccessMode instance. |
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.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. |
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 |
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 |
void |
resetElementCount()
TODO. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set a property specified by the name to the passed value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.exolab.castor.mapping.ClassDescriptor |
---|
getJavaClass |
Field Detail |
---|
protected XMLFieldDescriptor[] _elementDescriptors
XMLFieldDescriptor
s for all members that should be marshalled
as XML elements.
protected XMLFieldDescriptor[] _attributeDescriptors
XMLFieldDescriptor
s for all members that should be marshalled
as XML attributes.
protected java.lang.String _nsPrefix
protected java.lang.String _nsURI
protected java.lang.String _xmlName
protected XMLFieldDescriptorImpl _contentDescriptor
XMLFieldDescriptor
for the member that should be marshalled as text content.
Constructor Detail |
---|
public BaseHarnessDescriptor()
Method Detail |
---|
public XMLFieldDescriptor[] getAttributeDescriptors()
getAttributeDescriptors
in interface XMLClassDescriptor
public XMLFieldDescriptor[] getElementDescriptors()
getElementDescriptors
in interface XMLClassDescriptor
public java.lang.String getNameSpaceURI()
getNameSpaceURI
in interface XMLClassDescriptor
public java.lang.String getXMLName()
getXMLName
in interface XMLClassDescriptor
public java.lang.String getNameSpacePrefix()
getNameSpacePrefix
in interface XMLClassDescriptor
public void checkDescriptorForCorrectOrderWithinSequence(XMLFieldDescriptor elementDescriptor, UnmarshalState parentState, java.lang.String xmlName) throws ValidationException
checkDescriptorForCorrectOrderWithinSequence
in interface XMLClassDescriptor
elementDescriptor
- The XML field descriptor to be checkedxmlName
- TODO
ValidationException
- If the descriptor is not the one expectedpublic XMLFieldDescriptor getContentDescriptor()
getContentDescriptor
in interface XMLClassDescriptor
public FieldDescriptor getIdentity()
getIdentity
in interface ClassDescriptor
public AccessMode getAccessMode()
AccessMode
instance.
public ClassDescriptor getExtends()
getExtends
in interface ClassDescriptor
public TypeValidator getValidator()
getValidator
in interface XMLClassDescriptor
public 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 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 contains other object), in this particular case the implementation will return null.
canAccept
in interface XMLClassDescriptor
name
- the xml name of the field to checknamespace
- the namespace URIobject
- the object represented by this XMLCLassDescriptor
public void resetElementCount()
public FieldDescriptor[] getFields()
getFields
in interface ClassDescriptor
public XMLFieldDescriptor getFieldDescriptor(java.lang.String name, java.lang.String namespace, NodeType nodeType)
getFieldDescriptor
in interface XMLClassDescriptor
name
- the xml name to match againstnamespace
- the xml namspace to match againstnodeType
- the NodeType to match against, or null if
the node type is not known.
public boolean isChoice()
isChoice
in interface XMLClassDescriptor
public java.lang.Object getProperty(java.lang.String name)
PropertyHolder
getProperty
in interface PropertyHolder
name
- of the property
getProperty(java.lang.String)
public void setProperty(java.lang.String name, java.lang.Object value)
PropertyHolder
setProperty
in interface PropertyHolder
name
- of the propertyvalue
- of the propertysetProperty(java.lang.String, java.lang.Object)
public void addNature(java.lang.String nature)
NatureExtendable
addNature
in interface NatureExtendable
nature
- ID of the NatureaddNature(java.lang.String)
public boolean hasNature(java.lang.String nature)
NatureExtendable
hasNature
in interface NatureExtendable
nature
- ID of the Nature
hasNature(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |