Class MetadataObjectWriter
- java.lang.Object
-
- com._1c.g5.v8.dt.md.export.xml.writer.MetadataObjectWriter
-
- All Implemented Interfaces:
ISpecifiedElementWriter
public class MetadataObjectWriter extends Object implements ISpecifiedElementWriter
Specified writer forMdObject
Base point to write metadata objects
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com._1c.g5.v8.dt.export.xml.writer.ISpecifiedElementWriter
ISpecifiedElementWriter.ZeroWriter
-
-
Field Summary
-
Fields inherited from interface com._1c.g5.v8.dt.export.xml.writer.ISpecifiedElementWriter
SMART_ELEMENT_WRITER
-
-
Constructor Summary
Constructors Constructor Description MetadataObjectWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<org.eclipse.emf.ecore.EStructuralFeature>
getChildrenFeatureList(MdObject mdObject, Version version)
Returns ordered children feature list of specified metadata objectprotected List<org.eclipse.emf.ecore.EStructuralFeature>
getInnerInfoFeatureList(MdObject mdObject, Version version)
Returns ordered inner infos feature list of specified metadata objectprotected List<org.eclipse.emf.ecore.EStructuralFeature>
getPropertiesFeatureList(MdObject mdObject, Version version)
Returns ordered properties feature list of specified metadata objectprotected boolean
isFeatureSupportedByVersion(org.eclipse.emf.ecore.EStructuralFeature feature, Version version)
Check feature is supported be specific versionvoid
write(ExportXmlStreamWriter writer, org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EStructuralFeature feature, boolean writeEmpty, Version version)
Write value from eObject-feature reference by specified rulesprotected void
writeMdObject(ExportXmlStreamWriter writer, QName name, Object object, Version version)
Write metadata object to the XML writer.protected void
writeMdObjectChildObject(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature)
Write metadata object child object feature to the XML writer.protected void
writeMdObjectInternalInfo(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature)
Write metadata object internal info feature to the XML writer.protected void
writeMdObjectProperty(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature)
Write metadata object property feature to the XML writer.protected void
writeMdObjectSmartFeature(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature)
Write metadata object feature to the XML writer using smart feature writer.protected void
writeUnsupportedObjectsRefs(ExportXmlStreamWriter writer, Version version, MdObject mdObject)
Write metadata object unsupported object references to the XML writer.
-
-
-
Method Detail
-
write
public void write(ExportXmlStreamWriter writer, org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EStructuralFeature feature, boolean writeEmpty, Version version) throws ExportException, XMLStreamException
Description copied from interface:ISpecifiedElementWriter
Write value from eObject-feature reference by specified rules- Specified by:
write
in interfaceISpecifiedElementWriter
- Parameters:
writer
- the xmlExportXmlStreamWriter
, cannot benull
parent
- context object, cannot benull
feature
- theEStructuralFeature
, cannot benull
writeEmpty
- write empty element iftrue
or nothing iffalse
version
- the exporting projectVersion
, cannot benull
- Throws:
ExportException
- if export processing errorsXMLStreamException
- if unexpected processing errors
-
writeMdObject
protected void writeMdObject(ExportXmlStreamWriter writer, QName name, Object object, Version version) throws XMLStreamException, ExportException
Write metadata object to the XML writer.- Parameters:
writer
- the xmlExportXmlStreamWriter
, cannot benull
name
- the object name, cannot benull
object
- the object to write, cannot benull
version
- the exporting projectVersion
, cannot benull
- Throws:
XMLStreamException
- if unexpected processing errorsExportException
- if export processing errors
-
getInnerInfoFeatureList
protected List<org.eclipse.emf.ecore.EStructuralFeature> getInnerInfoFeatureList(MdObject mdObject, Version version)
Returns ordered inner infos feature list of specified metadata object- Parameters:
mdObject
- the source metadata object, cannot benull
version
- actual projectVersion
, cannot benull
- Returns:
- ordered inner infos feature list, never
null
-
getPropertiesFeatureList
protected List<org.eclipse.emf.ecore.EStructuralFeature> getPropertiesFeatureList(MdObject mdObject, Version version)
Returns ordered properties feature list of specified metadata object- Parameters:
mdObject
- the source metadata object, cannot benull
version
- actual projectVersion
, cannot benull
- Returns:
- ordered properties feature list, never
null
-
getChildrenFeatureList
protected List<org.eclipse.emf.ecore.EStructuralFeature> getChildrenFeatureList(MdObject mdObject, Version version)
Returns ordered children feature list of specified metadata object- Parameters:
mdObject
- the source metadata object, cannot benull
version
- actual projectVersion
, cannot benull
- Returns:
- ordered properties feature list, never
null
-
writeMdObjectInternalInfo
protected void writeMdObjectInternalInfo(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature) throws XMLStreamException, ExportException
Write metadata object internal info feature to the XML writer.- Parameters:
writer
- the xmlExportXmlStreamWriter
, cannot benull
version
- the exporting projectVersion
, cannot benull
mdObject
- the metadata object to write, cannot benull
feature
- the feature to write, cannot benull
- Throws:
XMLStreamException
- if unexpected processing errorsExportException
- if export processing errors
-
writeMdObjectProperty
protected void writeMdObjectProperty(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature) throws XMLStreamException, ExportException
Write metadata object property feature to the XML writer.- Parameters:
writer
- the xmlExportXmlStreamWriter
, cannot benull
version
- the exporting projectVersion
, cannot benull
mdObject
- the metadata object to write, cannot benull
feature
- the feature to write, cannot benull
- Throws:
XMLStreamException
- if unexpected processing errorsExportException
- if export processing errors
-
writeMdObjectChildObject
protected void writeMdObjectChildObject(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature) throws XMLStreamException, ExportException
Write metadata object child object feature to the XML writer.- Parameters:
writer
- the xmlExportXmlStreamWriter
, cannot benull
version
- the exporting projectVersion
, cannot benull
mdObject
- the metadata object to write, cannot benull
feature
- the feature to write, cannot benull
- Throws:
XMLStreamException
- if unexpected processing errorsExportException
- if export processing errors
-
writeMdObjectSmartFeature
protected void writeMdObjectSmartFeature(ExportXmlStreamWriter writer, Version version, MdObject mdObject, org.eclipse.emf.ecore.EStructuralFeature feature) throws XMLStreamException, ExportException
Write metadata object feature to the XML writer using smart feature writer.- Parameters:
writer
- the xmlExportXmlStreamWriter
, cannot benull
version
- the exporting projectVersion
, cannot benull
mdObject
- the metadata object to write, cannot benull
feature
- the feature to write, cannot benull
- Throws:
XMLStreamException
- if unexpected processing errorsExportException
- if export processing errors
-
writeUnsupportedObjectsRefs
protected void writeUnsupportedObjectsRefs(ExportXmlStreamWriter writer, Version version, MdObject mdObject) throws ExportException, XMLStreamException
Write metadata object unsupported object references to the XML writer.- Parameters:
writer
- the xmlExportXmlStreamWriter
, cannot benull
version
- the exporting projectVersion
, cannot benull
mdObject
- the metadata object to write, cannot benull
- Throws:
XMLStreamException
- if unexpected processing errorsExportException
- if export processing errors
-
isFeatureSupportedByVersion
protected boolean isFeatureSupportedByVersion(org.eclipse.emf.ecore.EStructuralFeature feature, Version version)
Check feature is supported be specific version- Parameters:
feature
- the feature to check, cannot benull
version
- theVersion
, cannot benull
- Returns:
- whether feature is supported be specific version
-
-