|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xmlbeans.XmlDocumentProperties
public abstract class XmlDocumentProperties
This class is used to attach arbitrary information to an XML document. It also defines several well-known types of information that can be attached or found on a document.
For example, suppose you wanted to associate a filename with the document containing an xml object "xobj". This could be done via the following code:
tokenSource.documentProperties().set(XmlDocumentProperties.NAME, "MyFilename.xml");
To fetch the filename later, given an xobj2 anywhere in the same document, you can write:
filename = (String)tokenSource.documentProperties().get(XmlDocumentProperties.NAME);
Field Summary | |
---|---|
static java.lang.Object |
DOCTYPE_NAME
Doc type name |
static java.lang.Object |
DOCTYPE_PUBLIC_ID
Doc type public id |
static java.lang.Object |
DOCTYPE_SYSTEM_ID
Doc type system id |
static java.lang.Object |
ENCODING
Document encoding |
static java.lang.Object |
MESSAGE_DIGEST
SHA message digest |
static java.lang.Object |
SOURCE_NAME
Used to store the original name (a String) for the source from which the XML document was loaded. |
static java.lang.Object |
STANDALONE
Document standlone |
static java.lang.Object |
VERSION
Document version |
Constructor Summary | |
---|---|
XmlDocumentProperties()
|
Method Summary | |
---|---|
abstract java.lang.Object |
get(java.lang.Object key)
Returns a value previously attached to a document using set. |
java.lang.String |
getDoctypeName()
Returns the DOCTYPE name used in the <!DOCTYPE> declaration. |
java.lang.String |
getDoctypePublicId()
Returns the DOCTYPE public ID used in the <!DOCTYPE> declaration. |
java.lang.String |
getDoctypeSystemId()
Returns the DOCTYPE system ID used in the <!DOCTYPE> declaration. |
java.lang.String |
getEncoding()
Returns the encoding used for the XML document, as an ISO encoding name. |
byte[] |
getMessageDigest()
Returns the message digest used to summarize the document. |
java.lang.String |
getSourceName()
Returns the name of the XML document file. |
boolean |
getStandalone()
Returns the standalone property |
java.lang.String |
getVersion()
Returns the XML version string used in the <?xml?> declaration. |
abstract java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Attaches a value to the root of the document containing the given token source. |
abstract java.lang.Object |
remove(java.lang.Object key)
Removes a value previously attached to a document using set. |
void |
setDoctypeName(java.lang.String doctypename)
Sets the DOCTYPE name use in the <!DOCTYPE> declaration. |
void |
setDoctypePublicId(java.lang.String publicid)
Sets the DOCTYPE public ID to use in the <!DOCTYPE> declaration. |
void |
setDoctypeSystemId(java.lang.String systemid)
Sets the DOCTYPE system ID to use in the <!DOCTYPE> declaration. |
void |
setEncoding(java.lang.String encoding)
Sets the encoding to use for the XML document. |
void |
setMessageDigest(byte[] digest)
Sets the message digest used to summarize the document. |
void |
setSourceName(java.lang.String sourceName)
Sets the name of the XML document file. |
void |
setStandalone(boolean standalone)
Sets the standalone property. |
void |
setVersion(java.lang.String version)
Sets the XML version string to use in the <?xml?> declaration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object SOURCE_NAME
public static final java.lang.Object ENCODING
public static final java.lang.Object VERSION
public static final java.lang.Object STANDALONE
public static final java.lang.Object DOCTYPE_NAME
public static final java.lang.Object DOCTYPE_PUBLIC_ID
public static final java.lang.Object DOCTYPE_SYSTEM_ID
public static final java.lang.Object MESSAGE_DIGEST
Constructor Detail |
---|
public XmlDocumentProperties()
Method Detail |
---|
public void setSourceName(java.lang.String sourceName)
sourceName
- the name to setXmlOptions.setDocumentSourceName(java.lang.String)
public java.lang.String getSourceName()
XmlOptions.setDocumentSourceName(java.lang.String)
public void setEncoding(java.lang.String encoding)
encoding
- the ISO encoding nameXmlOptions.setCharacterEncoding(java.lang.String)
public java.lang.String getEncoding()
XmlOptions.setCharacterEncoding(java.lang.String)
public void setVersion(java.lang.String version)
version
- the XML version stringpublic java.lang.String getVersion()
public void setStandalone(boolean standalone)
standalone
- whether standalone is true or notpublic boolean getStandalone()
public void setDoctypeName(java.lang.String doctypename)
doctypename
- the doctypenamepublic java.lang.String getDoctypeName()
public void setDoctypePublicId(java.lang.String publicid)
publicid
- the public IDpublic java.lang.String getDoctypePublicId()
public void setDoctypeSystemId(java.lang.String systemid)
systemid
- the system IDpublic java.lang.String getDoctypeSystemId()
public void setMessageDigest(byte[] digest)
digest
- the bytes of the digestXmlOptions.setLoadMessageDigest()
public byte[] getMessageDigest()
XmlOptions.setLoadMessageDigest()
public abstract java.lang.Object put(java.lang.Object key, java.lang.Object value)
key
- The key: there can be one value for each key.value
- The value to attach to the document.public abstract java.lang.Object get(java.lang.Object key)
key
- The key: this is the key that was previously
passed to set to store the value.
public abstract java.lang.Object remove(java.lang.Object key)
key
- The key: this is the key that was previously
passed to set to store the value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |