|
J avolution v5.2 (J2SE 1.5+) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavolution.xml.XMLReferenceResolver
public class XMLReferenceResolver
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).
| Constructor Summary | |
|---|---|
XMLReferenceResolver()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
createReference(java.lang.Object obj,
XMLFormat.InputElement xml)
Creates a reference for the specified object (the identifier being specified by the input XML element). |
java.lang.Object |
readReference(XMLFormat.InputElement xml)
Reads the object referenced by the specified xml input element if any. |
void |
reset()
Resets the internal state of this object to its default values. |
void |
setIdentifierAttribute(java.lang.String name)
Sets the name of the identifier attribute (by default "id"). |
void |
setIdentifierAttribute(java.lang.String localName,
java.lang.String uri)
Sets the local name and namespace URI of the identifier attribute. |
void |
setReferenceAttribute(java.lang.String name)
Sets the name of the reference attribute (by default "ref"). |
void |
setReferenceAttribute(java.lang.String localName,
java.lang.String uri)
Sets the local name and namespace URI of the identifier attribute. |
boolean |
writeReference(java.lang.Object obj,
XMLFormat.OutputElement xml)
Writes a reference to the specified object into the specified XML element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLReferenceResolver()
| Method Detail |
|---|
public void setIdentifierAttribute(java.lang.String name)
"id").
If the name is null then the identifier attribute
is never read/written (which may prevent unmarshalling).
name - the name of the attribute or null.
public void setIdentifierAttribute(java.lang.String localName,
java.lang.String uri)
localName - the local name of the attribute or null.uri - the URI of the attribute or null if the attribute
has no namespace URI.public void setReferenceAttribute(java.lang.String name)
"ref").
If the name is null then the reference attribute
is never read/written (which may prevent unmarshalling).
name - the name of the attribute or null.
public void setReferenceAttribute(java.lang.String localName,
java.lang.String uri)
localName - the local name of the attribute or null.uri - the URI of the attribute or null if the attribute
has no namespace URI.
public boolean writeReference(java.lang.Object obj,
XMLFormat.OutputElement xml)
throws XMLStreamException
obj - the object for which the reference is written.xml - the output XML element.
true if a reference is written;
false if a new identifier is written.
XMLStreamException
public java.lang.Object readReference(XMLFormat.InputElement xml)
throws XMLStreamException
xml - the input XML element.
null if the specified
XML input does not have a reference attribute.
XMLStreamException
public void createReference(java.lang.Object obj,
XMLFormat.InputElement xml)
throws XMLStreamException
obj - the object being referenced.xml - the input XML element holding the reference identifier.
XMLStreamExceptionpublic void reset()
Reusable
reset in interface Reusable
|
J avolution v5.2 (J2SE 1.5+) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||