| |
|
| java.lang.Object javolution.xml.XMLReferenceResolver
XMLReferenceResolver | public class XMLReferenceResolver implements Reusable(Code) | | This class represents a resolver for XML cross references during
the marshalling/unmarshalling process.
Instances of this class may only be shared by
XMLObjectReader /
XMLObjectWriter running sequentially (for cross references
spawning multiple documents).
author: Jean-Marie Dautelle version: 4.0, September 4, 2006 |
XMLReferenceResolver | public XMLReferenceResolver()(Code) | | Default constructor.
|
createReference | public void createReference(Object obj, XMLFormat.InputElement xml) throws XMLStreamException(Code) | | Creates a reference for the specified object (the identifier
being specified by the input XML element).
The default implementation reads the identifier attribute (if any)
and associates it to the specified object.
Parameters: obj - the object being referenced. Parameters: xml - the input XML element holding the reference identifier. |
readReference | public Object readReference(XMLFormat.InputElement xml) throws XMLStreamException(Code) | | Reads the object referenced by the specified xml input element if any.
The default implementation reads the reference attribute to retrieve
the object.
Parameters: xml - the input XML element. the referenced object or null if the specified XML input does not have a reference attribute. |
reset | public void reset()(Code) | | |
setIdentifierAttribute | public void setIdentifierAttribute(String name)(Code) | | Sets the name of the identifier attribute (by default"id" ).
If the name is null then the identifier attribute
is never read/written (which may prevent unmarshalling).
Parameters: name - the name of the attribute or null . |
setIdentifierAttribute | public void setIdentifierAttribute(String localName, String uri)(Code) | | Sets the local name and namespace URI of the identifier attribute.
Parameters: localName - the local name of the attribute or null . Parameters: uri - the URI of the attribute or null if the attributehas no namespace URI. |
setReferenceAttribute | public void setReferenceAttribute(String name)(Code) | | Sets the name of the reference attribute (by default"ref" ).
If the name is null then the reference attribute
is never read/written (which may prevent unmarshalling).
Parameters: name - the name of the attribute or null . |
setReferenceAttribute | public void setReferenceAttribute(String localName, String uri)(Code) | | Sets the local name and namespace URI of the identifier attribute.
Parameters: localName - the local name of the attribute or null . Parameters: uri - the URI of the attribute or null if the attributehas no namespace URI. |
writeReference | public boolean writeReference(Object obj, XMLFormat.OutputElement xml) throws XMLStreamException(Code) | | Writes a reference to the specified object into the specified XML
element. The default implementation writes the reference into the
reference attribute and for the first occurences an identifier
(counter starting at 1) is written into the identifier attribute.
Parameters: obj - the object for which the reference is written. Parameters: xml - the output XML element. true if a reference is written;false if a new identifier is written. |
|
|
|