Class XmlSerializer
- java.lang.Object
-
- com._1c.g5.modeling.xml.serializer.XmlSerializer
-
- All Implemented Interfaces:
IXmlSerializer
- Direct Known Subclasses:
XmiSerializer
public class XmlSerializer extends Object implements IXmlSerializer
Сериализирует модель с учетом форматирования
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XmlSerializer.EClassFeaturePair
ПараEClass
иEStructuralFeature
static class
XmlSerializer.EObjectFeaturePair
ПараEObject
иEStructuralFeature
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.emf.ecore.EClass
anySimpleType
protected org.eclipse.emf.ecore.EClass
anyType
protected ICrossReferenceSerializer
crossReferenceSerializer
protected boolean
declareSchemaLocation
protected boolean
declareSchemaLocationImplementation
protected boolean
declareXML
protected boolean
declareXSI
protected XmlStringBuilder
doc
protected org.eclipse.emf.ecore.xmi.XMLResource.ElementHandler
elementHandler
protected String
encoding
protected Escape
escape
protected Escape
escapeURI
protected org.eclipse.emf.ecore.util.ExtendedMetaData
extendedMetaData
protected Lookup
featureTable
protected int
flushThreshold
protected org.eclipse.emf.ecore.xmi.XMLHelper
helper
protected String
idAttributeName
protected String
idAttributeNS
protected static int
INDEX_LOOKUP
protected boolean
keepAttributeLocation
protected boolean
lastElementIsOpen
protected org.eclipse.emf.ecore.xmi.XMLResource.XMLMap
map
protected static String
NAMESPACES_PREFIX_MAP
protected Map<?,?>
options
protected org.eclipse.emf.ecore.xmi.XMLResource.ResourceEntityHandler
resourceEntityHandler
protected boolean
saveTypeInfo
protected Map<XmlSerializer.EObjectFeaturePair,Integer>
usesManyFeature
protected static String
XMI_TAG_NS
protected FormattingXmlResource
xmlResource
protected org.eclipse.emf.ecore.EPackage
xmlSchemaTypePackage
protected org.eclipse.emf.ecore.xmi.XMLSave.XMLTypeInfo
xmlTypeInfo
protected String
xmlVersion
protected static String
XSI_NO_NAMESPACE_SCHEMA_LOCATION
protected static String
XSI_SCHEMA_LOCATION
protected static String
XSI_TYPE_NS
protected static String
XSI_XMLNS
-
Constructor Summary
Constructors Constructor Description XmlSerializer()
XmlSerializer(org.eclipse.emf.ecore.xmi.XMLHelper helper, Map<?,?> options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addNamespaceDeclarations()
protected void
collectNamespaceDeclarations(Map<String,String> newNameSpacesMap)
protected String
convertURI(String uri)
protected String
getContainmentReferenceName(IModelNode node)
protected String
getDatatypeValue(Object value, org.eclipse.emf.ecore.EStructuralFeature f, boolean isAttribute)
org.eclipse.emf.ecore.xmi.XMLHelper
getHelper()
protected String
getHREFValue(org.eclipse.emf.ecore.EReference r, org.eclipse.emf.ecore.EObject value)
protected String
getIDREFValue(org.eclipse.emf.ecore.EObject value)
protected String
getModelNodeName(IModelNode node)
protected String
getNonContainmentReferenceName(NonContainmentReferenceNode node)
Map<?,?>
getOptions()
void
init(org.eclipse.emf.ecore.xmi.XMLHelper helper, Map<?,?> options)
protected boolean
isDuplicateURI(String nsURI)
void
save(OutputStream outputStream)
void
save(org.eclipse.emf.ecore.xmi.XMLResource resource, OutputStream outputStream, Map<?,?> options)
protected void
saveTypeAttribute(NamespaceNode node, boolean rightWS)
void
setFormater(IFormatter formater)
void
setHelper(org.eclipse.emf.ecore.xmi.XMLHelper helper)
void
setOptions(Map<?,?> options)
protected void
startElement(String elementName)
boolean
traverse(INode node)
void
write(Writer os)
void
writeAscii(OutputStream os)
protected void
writeNamespaceNode(NamespaceNode node, boolean rightWS)
-
-
-
Field Detail
-
INDEX_LOOKUP
protected static final int INDEX_LOOKUP
- See Also:
- Constant Field Values
-
XSI_TYPE_NS
protected static final String XSI_TYPE_NS
- See Also:
- Constant Field Values
-
XSI_XMLNS
protected static final String XSI_XMLNS
- See Also:
- Constant Field Values
-
XSI_SCHEMA_LOCATION
protected static final String XSI_SCHEMA_LOCATION
- See Also:
- Constant Field Values
-
XSI_NO_NAMESPACE_SCHEMA_LOCATION
protected static final String XSI_NO_NAMESPACE_SCHEMA_LOCATION
- See Also:
- Constant Field Values
-
XMI_TAG_NS
protected static final String XMI_TAG_NS
- See Also:
- Constant Field Values
-
NAMESPACES_PREFIX_MAP
protected static final String NAMESPACES_PREFIX_MAP
- See Also:
- Constant Field Values
-
options
protected Map<?,?> options
-
helper
protected org.eclipse.emf.ecore.xmi.XMLHelper helper
-
doc
protected XmlStringBuilder doc
-
xmlResource
protected FormattingXmlResource xmlResource
-
declareXSI
protected boolean declareXSI
-
declareXML
protected boolean declareXML
-
saveTypeInfo
protected boolean saveTypeInfo
-
keepAttributeLocation
protected boolean keepAttributeLocation
-
lastElementIsOpen
protected boolean lastElementIsOpen
-
xmlTypeInfo
protected org.eclipse.emf.ecore.xmi.XMLSave.XMLTypeInfo xmlTypeInfo
-
escape
protected Escape escape
-
escapeURI
protected Escape escapeURI
-
featureTable
protected Lookup featureTable
-
encoding
protected String encoding
-
xmlVersion
protected String xmlVersion
-
idAttributeName
protected String idAttributeName
-
idAttributeNS
protected String idAttributeNS
-
declareSchemaLocation
protected boolean declareSchemaLocation
-
declareSchemaLocationImplementation
protected boolean declareSchemaLocationImplementation
-
xmlSchemaTypePackage
protected org.eclipse.emf.ecore.EPackage xmlSchemaTypePackage
-
extendedMetaData
protected org.eclipse.emf.ecore.util.ExtendedMetaData extendedMetaData
-
anySimpleType
protected org.eclipse.emf.ecore.EClass anySimpleType
-
anyType
protected org.eclipse.emf.ecore.EClass anyType
-
map
protected org.eclipse.emf.ecore.xmi.XMLResource.XMLMap map
-
elementHandler
protected org.eclipse.emf.ecore.xmi.XMLResource.ElementHandler elementHandler
-
resourceEntityHandler
protected org.eclipse.emf.ecore.xmi.XMLResource.ResourceEntityHandler resourceEntityHandler
-
usesManyFeature
protected Map<XmlSerializer.EObjectFeaturePair,Integer> usesManyFeature
-
flushThreshold
protected int flushThreshold
-
crossReferenceSerializer
@Inject(optional=true) protected ICrossReferenceSerializer crossReferenceSerializer
-
-
Constructor Detail
-
XmlSerializer
public XmlSerializer()
-
XmlSerializer
public XmlSerializer(org.eclipse.emf.ecore.xmi.XMLHelper helper, Map<?,?> options)
-
-
Method Detail
-
init
public void init(org.eclipse.emf.ecore.xmi.XMLHelper helper, Map<?,?> options)
- Specified by:
init
in interfaceIXmlSerializer
-
setFormater
public void setFormater(IFormatter formater)
- Specified by:
setFormater
in interfaceIXmlSerializer
-
getHelper
public org.eclipse.emf.ecore.xmi.XMLHelper getHelper()
-
setHelper
public void setHelper(org.eclipse.emf.ecore.xmi.XMLHelper helper)
-
getOptions
public Map<?,?> getOptions()
-
setOptions
public void setOptions(Map<?,?> options)
-
save
public void save(OutputStream outputStream) throws IOException
- Specified by:
save
in interfaceIXmlSerializer
- Throws:
IOException
-
save
public void save(org.eclipse.emf.ecore.xmi.XMLResource resource, OutputStream outputStream, Map<?,?> options) throws IOException
- Specified by:
save
in interfaceIXmlSerializer
- Throws:
IOException
-
write
public void write(Writer os) throws IOException
- Throws:
IOException
-
writeAscii
public void writeAscii(OutputStream os) throws IOException
- Throws:
IOException
-
traverse
public boolean traverse(INode node)
-
getContainmentReferenceName
protected String getContainmentReferenceName(IModelNode node)
-
getNonContainmentReferenceName
protected String getNonContainmentReferenceName(NonContainmentReferenceNode node)
-
getModelNodeName
protected String getModelNodeName(IModelNode node)
-
addNamespaceDeclarations
protected void addNamespaceDeclarations()
-
collectNamespaceDeclarations
protected void collectNamespaceDeclarations(Map<String,String> newNameSpacesMap)
-
isDuplicateURI
protected boolean isDuplicateURI(String nsURI)
-
startElement
protected void startElement(String elementName)
-
saveTypeAttribute
protected void saveTypeAttribute(NamespaceNode node, boolean rightWS)
-
writeNamespaceNode
protected void writeNamespaceNode(NamespaceNode node, boolean rightWS)
-
getDatatypeValue
protected String getDatatypeValue(Object value, org.eclipse.emf.ecore.EStructuralFeature f, boolean isAttribute)
-
getIDREFValue
protected String getIDREFValue(org.eclipse.emf.ecore.EObject value)
-
getHREFValue
protected String getHREFValue(org.eclipse.emf.ecore.EReference r, org.eclipse.emf.ecore.EObject value)
-
-