Package name.jurgenei.gradle.xml.sexpr
Class SExpressionSerializer
java.lang.Object
name.jurgenei.gradle.xml.sexpr.SExpressionSerializer
- All Implemented Interfaces:
ContentHandler,LexicalHandler
SAX content handler that writes bracket-based S-expression representation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRendering mode for serialized S-expression output.static enumSyntax compatibility mode. -
Constructor Summary
ConstructorsConstructorDescriptionSExpressionSerializer(Writer writer) Creates serializer usingSExpressionSerializer.OutputFormat.COMPACTmode.SExpressionSerializer(Writer writer, SExpressionSerializer.OutputFormat format) Creates serializer with explicit output format.SExpressionSerializer(Writer writer, SExpressionSerializer.OutputFormat format, SExpressionSerializer.SyntaxMode syntaxMode) Creates serializer with explicit output and syntax mode. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidcomment(char[] ch, int start, int length) voidendCDATA()voidvoidendDTD()voidendElement(String uri, String localName, String qName) voidvoidendPrefixMapping(String prefix) voidignorableWhitespace(char[] ch, int start, int length) voidprocessingInstruction(String target, String data) voidsetDocumentLocator(Locator locator) voidskippedEntity(String name) voidvoidvoidvoidstartElement(String uri, String localName, String qName, Attributes atts) voidstartEntity(String name) voidstartPrefixMapping(String prefix, String uri) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
SExpressionSerializer
Creates serializer usingSExpressionSerializer.OutputFormat.COMPACTmode.- Parameters:
writer- destination writer
-
SExpressionSerializer
Creates serializer with explicit output format.- Parameters:
writer- destination writerformat- requested rendering mode; defaults to compact whennull
-
SExpressionSerializer
public SExpressionSerializer(Writer writer, SExpressionSerializer.OutputFormat format, SExpressionSerializer.SyntaxMode syntaxMode) Creates serializer with explicit output and syntax mode.- Parameters:
writer- destination writerformat- rendering modesyntaxMode- syntax compatibility mode
-
-
Method Details
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceContentHandler
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler
-
startElement
- Specified by:
startElementin interfaceContentHandler
-
endElement
- Specified by:
endElementin interfaceContentHandler
-
characters
public void characters(char[] ch, int start, int length) - Specified by:
charactersin interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) - Specified by:
ignorableWhitespacein interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler
-
startDTD
- Specified by:
startDTDin interfaceLexicalHandler
-
endDTD
public void endDTD()- Specified by:
endDTDin interfaceLexicalHandler
-
startEntity
- Specified by:
startEntityin interfaceLexicalHandler
-
endEntity
- Specified by:
endEntityin interfaceLexicalHandler
-
startCDATA
public void startCDATA()- Specified by:
startCDATAin interfaceLexicalHandler
-
endCDATA
public void endCDATA()- Specified by:
endCDATAin interfaceLexicalHandler
-
comment
public void comment(char[] ch, int start, int length) - Specified by:
commentin interfaceLexicalHandler
-