Package com._1c.g5.modeling.xml.parser
Class AbstractSaxXmlParser
- java.lang.Object
-
- com._1c.g5.modeling.xml.parser.XmlParserAdapter
-
- com._1c.g5.modeling.xml.parser.AbstractSaxXmlParser
-
- All Implemented Interfaces:
IXmlParser
,org.eclipse.emf.ecore.xmi.XMLLoad
- Direct Known Subclasses:
SaxXmiParser
,SaxXmlParser
public abstract class AbstractSaxXmlParser extends XmlParserAdapter
Абстрактная реализация парсера. Поддерживает резолвинг символических ссылок и абстрактных типов соглассно аннотациям mapping модели
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractSaxXmlParser.AttributesProxy
-
Field Summary
Fields Modifier and Type Field Description protected static int
BUFFER_SIZE
protected org.eclipse.emf.ecore.xmi.XMLHelper
helper
protected InputStream
is
protected boolean
namespaceAware
protected Map<?,?>
options
protected org.eclipse.emf.ecore.xmi.XMLResource
resource
protected static String
SAX_LEXICAL_PROPERTY
-
Fields inherited from interface com._1c.g5.modeling.xml.parser.IXmlParser
OPTION_USE_SYMLINK
-
-
Constructor Summary
Constructors Constructor Description AbstractSaxXmlParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.eclipse.emf.ecore.xmi.XMLDefaultHandler
createDefaultHandler()
protected String
getEncoding()
Deprecated.since 2.2 The encoding will be reported by the parser using SAX 2 Locatorprotected void
handleErrors()
void
init(org.eclipse.emf.ecore.xmi.XMLHelper helper, Map<?,?> options)
void
load(org.eclipse.emf.ecore.xmi.XMLResource resource, InputStream inputStream, Map<?,?> options)
Start parsing with the default handler; either XMI or XML.void
load(org.eclipse.emf.ecore.xmi.XMLResource resource, Node node, Map<?,?> options)
void
load(org.eclipse.emf.ecore.xmi.XMLResource resource, InputSource inputSource, Map<?,?> options)
protected abstract DefaultHandler
makeDefaultHandler()
protected SAXParser
makeParser()
Make either a validating or non-validating parser; throw an if one could not be made.protected byte[]
readBuffer()
protected void
traverse(Node node, AbstractSaxXmlParser.AttributesProxy attributesProxy, DefaultHandler handler, LexicalHandler lexicalHandler)
protected void
traverseElement(Element element, AbstractSaxXmlParser.AttributesProxy attributesProxy, DefaultHandler handler, LexicalHandler lexicalHandler)
Special case: traversing root element using namespaces in scope-
Methods inherited from class com._1c.g5.modeling.xml.parser.XmlParserAdapter
parse
-
-
-
-
Field Detail
-
SAX_LEXICAL_PROPERTY
protected static final String SAX_LEXICAL_PROPERTY
- See Also:
- Constant Field Values
-
BUFFER_SIZE
protected static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
resource
protected org.eclipse.emf.ecore.xmi.XMLResource resource
-
is
protected InputStream is
-
helper
protected org.eclipse.emf.ecore.xmi.XMLHelper helper
-
options
protected Map<?,?> options
-
namespaceAware
protected boolean namespaceAware
-
-
Method Detail
-
init
public void init(org.eclipse.emf.ecore.xmi.XMLHelper helper, Map<?,?> options)
- Specified by:
init
in classXmlParserAdapter
-
load
public void load(org.eclipse.emf.ecore.xmi.XMLResource resource, InputStream inputStream, Map<?,?> options) throws IOException
Start parsing with the default handler; either XMI or XML.- Specified by:
load
in interfaceorg.eclipse.emf.ecore.xmi.XMLLoad
- Overrides:
load
in classXmlParserAdapter
- Throws:
IOException
-
load
public void load(org.eclipse.emf.ecore.xmi.XMLResource resource, InputSource inputSource, Map<?,?> options) throws IOException
- Specified by:
load
in interfaceorg.eclipse.emf.ecore.xmi.XMLLoad
- Overrides:
load
in classXmlParserAdapter
- Throws:
IOException
-
createDefaultHandler
public org.eclipse.emf.ecore.xmi.XMLDefaultHandler createDefaultHandler()
- Specified by:
createDefaultHandler
in interfaceorg.eclipse.emf.ecore.xmi.XMLLoad
- Overrides:
createDefaultHandler
in classXmlParserAdapter
-
load
public void load(org.eclipse.emf.ecore.xmi.XMLResource resource, Node node, Map<?,?> options) throws IOException
- Specified by:
load
in interfaceorg.eclipse.emf.ecore.xmi.XMLLoad
- Overrides:
load
in classXmlParserAdapter
- Throws:
IOException
-
makeDefaultHandler
protected abstract DefaultHandler makeDefaultHandler()
-
handleErrors
protected void handleErrors() throws IOException
- Throws:
IOException
-
makeParser
protected SAXParser makeParser() throws ParserConfigurationException, SAXException
Make either a validating or non-validating parser; throw an if one could not be made.
-
getEncoding
@Deprecated protected String getEncoding() throws IOException
Deprecated.since 2.2 The encoding will be reported by the parser using SAX 2 Locator- Throws:
IOException
-
readBuffer
protected byte[] readBuffer() throws IOException
- Throws:
IOException
-
traverseElement
protected void traverseElement(Element element, AbstractSaxXmlParser.AttributesProxy attributesProxy, DefaultHandler handler, LexicalHandler lexicalHandler) throws SAXException
Special case: traversing root element using namespaces in scope- Throws:
SAXException
-
traverse
protected void traverse(Node node, AbstractSaxXmlParser.AttributesProxy attributesProxy, DefaultHandler handler, LexicalHandler lexicalHandler) throws SAXException
- Throws:
SAXException
-
-