Class AbstractXmlFileReader
- java.lang.Object
-
- com._1c.g5.v8.dt.import_.xml.reader.AbstractXmlFileReader
-
- All Implemented Interfaces:
IXmlFileReader
- Direct Known Subclasses:
AbstractMdXmlFileReader
,FormXmlFileReader
public abstract class AbstractXmlFileReader extends Object implements IXmlFileReader
Abstract xml file reader
-
-
Field Summary
Fields Modifier and Type Field Description protected IXmlNodeFactory
nodeFactory
-
Constructor Summary
Constructors Constructor Description AbstractXmlFileReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract IXmlNode
getRootNode(Document doc)
Method to take core xml element for importing objectprotected String
getWrongAttributeValueMessage(String value, String path, String attributeName)
Generate error message about wrong attribute values in xmlprotected String
getXmlElementRequiredMessage(String path)
Generate error message about required xml elementprotected XmlFileReaderContext
getXmlFileReaderContext(Path path, org.eclipse.emf.ecore.EClass eClass, org.eclipse.emf.ecore.EStructuralFeature feature)
Create context object forread(IXmlNode, Version, XmlFileReaderContext)
protected abstract XmlReaderResult
read(IXmlNode node, Version version, XmlFileReaderContext readerContext)
Read xml nodeXmlReaderResult
read(Document document, Path path, org.eclipse.emf.ecore.EClass eClass, org.eclipse.emf.ecore.EStructuralFeature feature, Version version)
Read XML file to the XML reader result with the providedeClass
content.
-
-
-
Field Detail
-
nodeFactory
@Inject protected IXmlNodeFactory nodeFactory
-
-
Method Detail
-
read
public XmlReaderResult read(Document document, Path path, org.eclipse.emf.ecore.EClass eClass, org.eclipse.emf.ecore.EStructuralFeature feature, Version version)
Description copied from interface:IXmlFileReader
Read XML file to the XML reader result with the providedeClass
content.- Specified by:
read
in interfaceIXmlFileReader
- Parameters:
document
- the XML document parsed fromfile
, cannot benull
path
- the file path with XML document, cannot benull
eClass
- the class to read object with, cannot benull
feature
- the context feature containingeClass
ornull
if not neededversion
- the version of importing 1C:Enterprise XML files, cannot benull
- Returns:
- the
XmlReaderResult
as importing result with the providedeClass
content, nevernull
-
getRootNode
protected abstract IXmlNode getRootNode(Document doc)
Method to take core xml element for importing object
-
read
protected abstract XmlReaderResult read(IXmlNode node, Version version, XmlFileReaderContext readerContext)
Read xml node- Parameters:
node
- the core xml element for importing object, cannot benull
version
- xml runtime version, cannot benull
readerContext
- extended file reader context, cannot benull
- Returns:
- the
XmlReaderResult
as importing result, nevernull
-
getXmlFileReaderContext
protected XmlFileReaderContext getXmlFileReaderContext(Path path, org.eclipse.emf.ecore.EClass eClass, org.eclipse.emf.ecore.EStructuralFeature feature)
Create context object forread(IXmlNode, Version, XmlFileReaderContext)
- Parameters:
path
- the file path with XML document, cannot benull
eClass
- the class to read object with, cannot benull
feature
- the context feature containingeClass
ornull
if not needed- Returns:
- instance of
XmlFileReaderContext
, nevernull
-
getWrongAttributeValueMessage
protected String getWrongAttributeValueMessage(String value, String path, String attributeName)
Generate error message about wrong attribute values in xml- Parameters:
value
- the attribute value, can benull
path
- position of xml node in document, cannot benull
attributeName
- the name of attribute, cannot benull
- Returns:
- the error message, never
null
-
-