|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.platform.AbstractDepictContext
com.guiseframework.platform.AbstractTextDepictContext
com.guiseframework.platform.AbstractXMLDepictContext
public abstract class AbstractXMLDepictContext
Abstract encapsulation of text/xml information related to the current depiction.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.guiseframework.platform.XMLDepictContext |
|---|
XMLDepictContext.ElementState |
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Constructor Summary | |
|---|---|
AbstractXMLDepictContext(GuiseSession session,
Destination destination)
Guise session constructor. |
|
| Method Summary | |
|---|---|
void |
clearDepictText()
Clears all data collected for depiction. |
protected java.lang.String |
encode(java.lang.String string)
Encodes text information for writing. |
protected abstract java.lang.String |
getAttributeHashAttributeQualifiedName()
|
protected java.lang.String |
getAttributeValue(com.globalmentor.text.xml.QualifiedName elementQualifiedName,
com.globalmentor.text.xml.QualifiedName attributeQualifiedName,
java.lang.String attributeValue)
Retrieves the value of a given attribute. |
protected abstract java.lang.String |
getContentHashAttributeQualifiedName()
|
java.lang.StringBuilder |
getDepictStringBuilder()
The string builder that holds the current content being collected, though not necessarily all the content collected. |
protected java.security.MessageDigest |
getMessageDigest()
|
java.lang.String |
getQualifiedName(java.net.URI namespaceURI,
java.lang.String localName)
Retrieves the qualified name of the given namespace and local name. |
protected com.globalmentor.text.xml.XMLNamespacePrefixManager |
getXMLNamespacePrefixManager()
|
protected boolean |
isHashAttributesGenerated()
|
protected void |
setHashAttributesGenerated(boolean generateHashAttributes)
Sets whether attributes should be generated representing the hash of XML attributes and content. |
void |
writeAttribute(java.net.URI namespaceURI,
java.lang.String localName,
java.lang.String value)
Writes an attribute of an XML element. |
void |
writeComment(java.lang.String comment)
Writes an XML comment. |
void |
writeCommentClose()
Writes the ending part of an XML comment. |
void |
writeCommentOpen()
Writes the beginning part of an XML comment. |
void |
writeDocType(boolean writeXMLDeclaration,
java.net.URI namespaceURI,
java.lang.String localName,
java.lang.String publicID)
Writes a doctype along with an optional an XML declaration to the string builder and sets the output content type. |
void |
writeDocType(boolean writeXMLDeclaration,
java.net.URI namespaceURI,
java.lang.String localName,
java.lang.String publicID,
java.lang.String systemID,
com.globalmentor.net.ContentType contentType)
Writes a doctype along with an optional XML declaration to the string builder and sets the output content type. |
XMLDepictContext.ElementState |
writeElementBegin(java.net.URI namespaceURI,
java.lang.String localName)
Begins an XML element that will not be an empty element, even if it has no content. |
XMLDepictContext.ElementState |
writeElementBegin(java.net.URI namespaceURI,
java.lang.String localName,
boolean isEmptyElementAllowed)
Begins an XML element, specifying whether an empty element is allowed. |
XMLDepictContext.ElementState |
writeElementEnd(java.net.URI namespaceURI,
java.lang.String localName)
Ends an XML element. |
| Methods inherited from class com.guiseframework.platform.AbstractTextDepictContext |
|---|
getDepictText, getIndentLevel, indent, indent, isFormatted, setIndentLevel, unindent, write, write, writeIndent, writeLiteral |
| Methods inherited from class com.guiseframework.platform.AbstractDepictContext |
|---|
getDepictionURI, getDepictionURI, getDestination, getPlatform, getSession, getStyles |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.guiseframework.platform.TextDepictContext |
|---|
getDepictText, getIndentLevel, getOutputCharacterEncoding, getOutputContentType, indent, indent, isFormatted, setIndentLevel, setOutputContentType, unindent, write, write, writeIndent, writeLiteral |
| Methods inherited from interface com.guiseframework.platform.DepictContext |
|---|
getDepictionURI, getDepictionURI, getDepictionURI, getDestination, getPlatform, getSession, getStyles |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public AbstractXMLDepictContext(GuiseSession session,
Destination destination)
throws java.io.IOException
session - The Guise user session of which this context is a part.destination - The destination with which this context is associated.
java.lang.NullPointerException - if the given session and/or destination is null.
java.io.IOException - If there was an I/O error loading a needed resource.| Method Detail |
|---|
protected java.security.MessageDigest getMessageDigest()
protected com.globalmentor.text.xml.XMLNamespacePrefixManager getXMLNamespacePrefixManager()
protected boolean isHashAttributesGenerated()
protected void setHashAttributesGenerated(boolean generateHashAttributes)
generateHashAttribute - Whether hash attributes should be generated.protected abstract java.lang.String getAttributeHashAttributeQualifiedName()
protected abstract java.lang.String getContentHashAttributeQualifiedName()
public void clearDepictText()
clearDepictText in interface TextDepictContextclearDepictText in class AbstractTextDepictContextpublic java.lang.StringBuilder getDepictStringBuilder()
getDepictStringBuilder in interface TextDepictContextgetDepictStringBuilder in class AbstractTextDepictContextprotected java.lang.String encode(java.lang.String string)
encode in class AbstractTextDepictContextstring - The text information to encode.
protected java.lang.String getAttributeValue(com.globalmentor.text.xml.QualifiedName elementQualifiedName,
com.globalmentor.text.xml.QualifiedName attributeQualifiedName,
java.lang.String attributeValue)
elementQualifedName - The qualified name of the element.attributeQualifiedName - The qualified name of the attribute.attributeValue - The default value of the attribute.
public java.lang.String getQualifiedName(java.net.URI namespaceURI,
java.lang.String localName)
null namespace,
but cannot work for elements in the null namespace because this would be ambiguous with elements in the the XHTML namespace.
getQualifiedName in interface XMLDepictContextnamespaceURI - The URI of the XML namespace, or null if there is no namespace and there should be no prefix.localName - The local name of the element or attribute with no prefix.
public void writeDocType(boolean writeXMLDeclaration,
java.net.URI namespaceURI,
java.lang.String localName,
java.lang.String publicID)
throws java.io.IOException
writeDocType in interface XMLDepictContextwriteXMLDeclaration - Whether an XML declaration should be included before the doctype.namespaceURI - The URI of the XML namespace of document element, or null if there is no namespace.localName - The local name of the document element with no prefix.publicID - The XML declaration public ID.
java.lang.NullPointerException - if the given public ID is null.
java.lang.IllegalArgumentException - if a system ID could not be determined from the given public ID.
java.io.IOException
public void writeDocType(boolean writeXMLDeclaration,
java.net.URI namespaceURI,
java.lang.String localName,
java.lang.String publicID,
java.lang.String systemID,
com.globalmentor.net.ContentType contentType)
throws java.io.IOException
writeDocType in interface XMLDepictContextwriteXMLDeclaration - Whether an XML declaration should be included before the doctype.namespaceURI - The URI of the XML namespace of document element, or null if there is no namespace.localName - The local name of the document element with no prefix.publicID - The XML declaration public ID, or null if none is used.systemID - The XML declaration system ID, or null if one can be determined from the given public ID.contentType - The specific XML content type, or null if a content type should be determiend from the public ID; otherwise will default to "text/xml".
java.lang.IllegalArgumentException - if a system ID was not provided or one could not be determined from the given public ID.
java.io.IOException
public XMLDepictContext.ElementState writeElementBegin(java.net.URI namespaceURI,
java.lang.String localName)
throws java.io.IOException
writeElementBegin in interface XMLDepictContextnamespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.localName - The local name of the element with no prefix.
java.io.IOException - if there is an error writing the information.
public XMLDepictContext.ElementState writeElementBegin(java.net.URI namespaceURI,
java.lang.String localName,
boolean isEmptyElementAllowed)
throws java.io.IOException
writeElementBegin in interface XMLDepictContextnamespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.localName - The local name of the element with no prefix.isEmptyElementAllowed - Whether an empty element can be created if there is no content.
java.io.IOException - if there is an error writing the information.
public XMLDepictContext.ElementState writeElementEnd(java.net.URI namespaceURI,
java.lang.String localName)
throws java.io.IOException
writeElementEnd in interface XMLDepictContextnamespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.localName - The local name of the element with no prefix.
java.util.NoSuchElementException - if the element state stack is empty.
java.lang.IllegalStateException - if the given namespace URI and/or local name does not match that of the currently open element.
java.io.IOException - if there is an error writing the information.
public void writeAttribute(java.net.URI namespaceURI,
java.lang.String localName,
java.lang.String value)
throws java.io.IOException
writeAttribute in interface XMLDepictContextnamespaceURI - The URI of the XML namespace of the attribute, or null if there is no namespace.localName - The local name of the attribute with no prefix.value - The unencoded value of the attribute.
java.util.NoSuchElementException - if the element state stack is empty.
java.io.IOException - if there is an error writing the information.
public void writeCommentOpen()
throws java.io.IOException
writeCommentOpen in interface XMLDepictContextjava.lang.IllegalStateException - if the comment has already been opened but not closed.
java.io.IOException - if there is an error writing the information.writeCommentClose()
public void writeCommentClose()
throws java.io.IOException
writeCommentClose in interface XMLDepictContextjava.lang.IllegalStateException - if the comment has not been opened or has already been closed.
java.io.IOException - if there is an error writing the information.writeCommentOpen()
public void writeComment(java.lang.String comment)
throws java.io.IOException
writeComment in interface XMLDepictContextcomment - The comment to write.
java.io.IOException - if there is an error writing the information.writeCommentOpen(),
writeCommentClose()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||