@NotThreadSafe public class XMLEmitterPhloc extends DefaultXMLIterationHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
CDATA_END |
static String |
CDATA_START |
static String |
COMMENT_END |
static String |
COMMENT_START |
static boolean |
DEFAULT_THROW_EXCEPTION_ON_NESTED_COMMENTS
By default an exception is thrown for nested comments
|
static char |
ER_END |
static char |
ER_START |
static String |
PI_END |
static String |
PI_START |
| Constructor and Description |
|---|
XMLEmitterPhloc(Writer aWriter,
IXMLWriterSettings aSettings) |
| Modifier and Type | Method and Description |
|---|---|
static String |
getDocTypeHTMLRepresentation(EXMLSerializeVersion eXMLVersion,
EXMLIncorrectCharacterHandling eIncorrectCharHandling,
IMicroDocumentType aDocType)
Get the XML representation of a document type.
|
static String |
getDocTypeHTMLRepresentation(EXMLSerializeVersion eXMLVersion,
EXMLIncorrectCharacterHandling eIncorrectCharHandling,
String sQualifiedName,
String sPublicID,
String sSystemID)
Get the XML representation of a document type.
|
static boolean |
isThrowExceptionOnNestedComments() |
void |
onCDATA(String sText)
CDATA node.
|
void |
onComment(String sComment)
Comment node.
|
void |
onContentElementWhitespace(CharSequence aWhitespaces)
Ignorable whitespace characters.
|
void |
onDocumentStart(EXMLVersion eVersion,
String sEncoding,
boolean bStandalone)
At the very beginning of the document.
|
void |
onDocumentType(String sQualifiedElementName,
String sPublicID,
String sSystemID)
On XML document type.
|
void |
onElementEnd(String sNamespacePrefix,
String sTagName,
boolean bHasChildren)
End of an element.
|
void |
onElementStart(String sNamespacePrefix,
String sTagName,
Map<String,String> aAttrs,
boolean bHasChildren)
Start of an element.
|
void |
onEntityReference(String sEntityRef)
On entity reference.
|
void |
onProcessingInstruction(String sTarget,
String sData)
On processing instruction
|
void |
onText(String sText,
boolean bEscape)
Text node.
|
static void |
setThrowExceptionOnNestedComments(boolean bThrowExceptionOnNestedComments)
Define whether nested XML comments throw an exception or not.
|
String |
toString() |
public static final boolean DEFAULT_THROW_EXCEPTION_ON_NESTED_COMMENTS
public static final String CDATA_START
public static final String CDATA_END
public static final String COMMENT_START
public static final String COMMENT_END
public static final char ER_START
public static final char ER_END
public static final String PI_START
public static final String PI_END
public XMLEmitterPhloc(@Nonnull@WillNotClose Writer aWriter, @Nonnull IXMLWriterSettings aSettings)
public static void setThrowExceptionOnNestedComments(boolean bThrowExceptionOnNestedComments)
bThrowExceptionOnNestedComments - true to throw an exception, false to
ignore nested comments.public static boolean isThrowExceptionOnNestedComments()
true if nested XML comments will throw an error.
Default is true.public void onDocumentStart(@Nullable EXMLVersion eVersion, @Nullable String sEncoding, boolean bStandalone)
IXMLIterationHandleronDocumentStart in interface IXMLIterationHandleronDocumentStart in class DefaultXMLIterationHandlereVersion - The XML version to use. If null is passed,
EXMLVersion.DEFAULT will be used.sEncoding - The encoding to be used for this document. It may be
null but it is strongly recommended to write a correct
charset.bStandalone - if true this is a standalone XML document without a
connection to an existing DTD or XML schema@Nonnull public static String getDocTypeHTMLRepresentation(@Nonnull EXMLSerializeVersion eXMLVersion, @Nonnull EXMLIncorrectCharacterHandling eIncorrectCharHandling, @Nonnull IMicroDocumentType aDocType)
eXMLVersion - The XML version to use. May not be null.eIncorrectCharHandling - The incorrect character handling. May not be null.aDocType - The structure document type. May not be null.@Nonnull public static String getDocTypeHTMLRepresentation(@Nonnull EXMLSerializeVersion eXMLVersion, @Nonnull EXMLIncorrectCharacterHandling eIncorrectCharHandling, @Nonnull String sQualifiedName, @Nullable String sPublicID, @Nullable String sSystemID)
eXMLVersion - The XML version to use. May not be null.eIncorrectCharHandling - The incorrect character handling. May not be null.sQualifiedName - The qualified element name. May not be null.sPublicID - The optional public ID. May be null. If the public ID
is not null the system ID must also be set!sSystemID - The optional system ID. May be null.public void onDocumentType(@Nonnull String sQualifiedElementName, @Nullable String sPublicID, @Nullable String sSystemID)
IXMLIterationHandleronDocumentType in interface IXMLIterationHandleronDocumentType in class DefaultXMLIterationHandlersQualifiedElementName - Qualified name of the root element.sPublicID - Document type public IDsSystemID - Document type system IDpublic void onProcessingInstruction(@Nonnull String sTarget, @Nullable String sData)
IXMLIterationHandleronProcessingInstruction in interface IXMLIterationHandleronProcessingInstruction in class DefaultXMLIterationHandlersTarget - The targetsData - The data (attributes as a string)public void onEntityReference(@Nonnull String sEntityRef)
IXMLIterationHandleronEntityReference in interface IXMLIterationHandleronEntityReference in class DefaultXMLIterationHandlersEntityRef - The reference (without '&' and ';' !!)public void onContentElementWhitespace(@Nullable CharSequence aWhitespaces)
IXMLIterationHandleronContentElementWhitespace in interface IXMLIterationHandleronContentElementWhitespace in class DefaultXMLIterationHandleraWhitespaces - The whitespace character sequencepublic void onComment(@Nullable String sComment)
IXMLIterationHandleronComment in interface IXMLIterationHandleronComment in class DefaultXMLIterationHandlersComment - The comment textpublic void onText(@Nullable String sText, boolean bEscape)
IXMLIterationHandleronText in interface IXMLIterationHandleronText in class DefaultXMLIterationHandlersText - The contained textbEscape - If true the text should be XML masked,
false if not. The false case is especially
interesting for HTML inline JS and CSS code.public void onCDATA(@Nullable String sText)
IXMLIterationHandleronCDATA in interface IXMLIterationHandleronCDATA in class DefaultXMLIterationHandlersText - The contained textpublic void onElementStart(@Nullable String sNamespacePrefix, @Nonnull String sTagName, @Nullable Map<String,String> aAttrs, boolean bHasChildren)
IXMLIterationHandleronElementStart in interface IXMLIterationHandleronElementStart in class DefaultXMLIterationHandlersNamespacePrefix - Optional namespace prefix. May be null.sTagName - Tag nameaAttrs - Optional set of attributes.bHasChildren - true if the current element has childrenpublic void onElementEnd(@Nullable String sNamespacePrefix, @Nonnull String sTagName, boolean bHasChildren)
IXMLIterationHandleronElementEnd in interface IXMLIterationHandleronElementEnd in class DefaultXMLIterationHandlersNamespacePrefix - Optional namespace prefix. May be null.sTagName - Tag namebHasChildren - true if the current element has childrenCopyright © 2006–2014 phloc systems. All rights reserved.