Package com._1c.g5.v8.dt.xdto.resource
Class XdtoToXsdSerializer
- java.lang.Object
-
- com._1c.g5.v8.dt.xdto.model.resource.AbstractXdtoSerializer
-
- com._1c.g5.v8.dt.xdto.resource.XdtoToXsdSerializer
-
public class XdtoToXsdSerializer extends AbstractXdtoSerializer
Special class for import/export XDTO Package content to the xsd scheme
-
-
Field Summary
Fields Modifier and Type Field Description static String
NS_PREFIX
static String
SCHEMA
static String
TNS_PREFIX
-
Fields inherited from class com._1c.g5.v8.dt.xdto.model.resource.AbstractXdtoSerializer
ABSTRACT, BASE, DEFAULT, ENCODING, ENUMERATION, FIXED, FORM, FRACTION_DIGITS, IMPORT, ITEM_TYPE, LENGTH, MAX_EXCLUSIVE, MAX_INCLUSIVE, MAX_LENGTH, MIN_EXCLUSIVE, MIN_INCLUSIVE, MIN_LENGTH, MIXED, NAME, NAMESPACE, NILLABLE, OPEN, PATTERN, REF, SCHEMA_LOCATION, TARGET_NAMESPACE, TOTAL_DIGITS, TYPE, WHITESPACE, XMLNS_PREFIX, XS_PREFIX, XS_URI
-
-
Constructor Summary
Constructors Constructor Description XdtoToXsdSerializer()
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Package
deserialize(XMLStreamReader reader, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature featureToSet)
Convert xsd scheme to Xdto objectPackage
void
exportToXsd(Package pack, OutputStream outputStream)
Exports package to the xsd format.void
exportToXsd(Package pack, Path path)
Exports package to the xsd format.void
exportToXsd(XdtoResource resource, OutputStream outputStream)
Exports 1st resource element to the xsd formatCollection<String>
importFromXsd(XdtoResource resource, InputStream inputStream)
Convert xsd scheme to Xdto objectPackage
-
Methods inherited from class com._1c.g5.v8.dt.xdto.model.resource.AbstractXdtoSerializer
convertLineEndings, createAttributeName, decreaceIndent, getNewPrefix, increaseIndent, writeFormatCharacters
-
-
-
-
Field Detail
-
NS_PREFIX
public static final String NS_PREFIX
- See Also:
- Constant Field Values
-
SCHEMA
public static final String SCHEMA
- See Also:
- Constant Field Values
-
TNS_PREFIX
public static final String TNS_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
exportToXsd
public void exportToXsd(XdtoResource resource, OutputStream outputStream) throws IOException
Exports 1st resource element to the xsd format- Parameters:
resource
-XdtoResource
for exporting, can't benull
and should have one root elementoutputStream
- stream for writing xsd format, can't benull
- Throws:
IOException
- if I/O or xml exception were occurred
-
exportToXsd
public void exportToXsd(Package pack, OutputStream outputStream) throws IOException
Exports package to the xsd format.- Parameters:
pack
-Package
for exporting, can't benull
outputStream
- stream for writing xsd format, can't benull
- Throws:
IOException
- if I/O or xml exception is occurred
-
exportToXsd
public void exportToXsd(Package pack, Path path) throws IOException
Exports package to the xsd format.- Parameters:
pack
-Package
for exporting, can't benull
path
-Path
to the file for writing xsd format, can't benull
- Throws:
IOException
- if I/O or xml exception is occurred
-
importFromXsd
public Collection<String> importFromXsd(XdtoResource resource, InputStream inputStream) throws IOException
Convert xsd scheme to Xdto objectPackage
- Parameters:
resource
-XdtoResource
for creatingPackage
, can't benull
inputStream
- stream for reading xsd scheme content, can't benull
- Throws:
IOException
- if I/O or xml exception were occurred
-
deserialize
public Package deserialize(XMLStreamReader reader, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature featureToSet) throws XMLStreamException
Convert xsd scheme to Xdto objectPackage
- Parameters:
reader
- actualXMLStreamReader
for reading xml structure text, can't benull
container
- object for settingPackage
, can't benull
featureToSet
-EStructuralFeature
for settingPackage
, can't benull
- Returns:
- read
Package
, nevernull
- Throws:
XMLStreamException
- if invalid xml structure was found
-
-