public class Handler
extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.ext.LexicalHandler, org.xml.sax.ext.DeclHandler
Constructor and Description |
---|
Handler(org.omegat.filters3.xml.Translator translator,
XMLDialect dialect,
java.io.File inFile,
java.io.File outFile,
FilterContext fc)
Creates a new instance of Handler
|
Modifier and Type | Method and Description |
---|---|
void |
attributeDecl(java.lang.String eName,
java.lang.String aName,
java.lang.String type,
java.lang.String valueDefault,
java.lang.String value)
Not used: An attribute type declaration.
|
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data inside an element.
|
void |
comment(char[] ch,
int start,
int length)
Receive notification of an XML comment anywhere in the document.
|
org.xml.sax.InputSource |
doResolve(java.lang.String publicId,
java.lang.String systemId)
Resolves external entity and creates a new writer if it's an included
file.
|
void |
elementDecl(java.lang.String name,
java.lang.String model)
Not used: An element type declaration.
|
void |
endCDATA()
Report the end of a CDATA section.
|
void |
endDocument()
Receive notification of the end of the document.
|
void |
endDTD()
Report the end of DTD declarations.
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Receive notification of the end of an element.
|
void |
endEntity(java.lang.String name)
Report the end of an entity.
|
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Report a parsed external entity declaration.
|
void |
fatalError(org.xml.sax.SAXParseException e)
Report a fatal XML parsing error.
|
FilterContext |
getContext() |
java.util.List<java.io.File> |
getProcessedFiles()
Returns external files this handler has processed, because they were
included into main file.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Receive notification of ignorable whitespace in element content.
|
void |
internalEntityDecl(java.lang.String name,
java.lang.String value)
Report an internal entity declaration.
|
boolean |
isParagraphTag(Tag tag)
Returns whether the tag starts a new paragraph.
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Receive notification of an XML processing instruction anywhere in the
document.
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolves an external entity.
|
void |
startCDATA()
Report the start of a CDATA section.
|
void |
startDocument()
Receive notification of the beginning of the document.
|
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Report the start of DTD declarations, if any.
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
Receive notification of the start of an element.
|
void |
startEntity(java.lang.String name)
Not used: Report the beginning of some internal and external XML
entities.
|
public Handler(org.omegat.filters3.xml.Translator translator, XMLDialect dialect, java.io.File inFile, java.io.File outFile, FilterContext fc) throws java.io.IOException
java.io.IOException
public java.util.List<java.io.File> getProcessedFiles()
File
.public FilterContext getContext()
public org.xml.sax.InputSource doResolve(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException, TranslationException, java.io.IOException, java.net.URISyntaxException
org.xml.sax.SAXException
TranslationException
java.io.IOException
java.net.URISyntaxException
public boolean isParagraphTag(Tag tag)
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
resolveEntity
in interface org.xml.sax.EntityResolver
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
comment
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
processingInstruction
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
startDTD
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endDTD() throws org.xml.sax.SAXException
endDTD
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void startCDATA() throws org.xml.sax.SAXException
startCDATA
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endCDATA() throws org.xml.sax.SAXException
endCDATA
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
startEntity
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException
endEntity
in interface org.xml.sax.ext.LexicalHandler
name
- The name of the entity that is ending.org.xml.sax.SAXException
- The application may raise an exception.startEntity(java.lang.String)
public void internalEntityDecl(java.lang.String name, java.lang.String value) throws org.xml.sax.SAXException
internalEntityDecl
in interface org.xml.sax.ext.DeclHandler
org.xml.sax.SAXException
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
externalEntityDecl
in interface org.xml.sax.ext.DeclHandler
org.xml.sax.SAXException
public void elementDecl(java.lang.String name, java.lang.String model)
elementDecl
in interface org.xml.sax.ext.DeclHandler
public void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String valueDefault, java.lang.String value)
attributeDecl
in interface org.xml.sax.ext.DeclHandler