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. In platform native code see - src\xdto\src\XDTOSchemaSupportImpl.cpp: XDTOModelBuilder::createValueType, XDTOModelBuilder::createObjectType
-
-
Field Summary
Fields Modifier and Type Field Description static StringNS_PREFIXstatic StringSCHEMAstatic StringTNS_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 Packagedeserialize(XMLStreamReader reader, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature featureToSet)Convert xsd scheme to Xdto objectPackagevoidexportToXsd(Package pack, OutputStream outputStream)Exports package to the xsd format.voidexportToXsd(Package pack, Path path)Exports package to the xsd format.voidexportToXsd(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-XdtoResourcefor exporting, can't benulland 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-Packagefor exporting, can't benulloutputStream- 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-Packagefor exporting, can't benullpath-Pathto 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-XdtoResourcefor creatingPackage, can't benullinputStream- 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- actualXMLStreamReaderfor reading xml structure text, can't benullcontainer- object for settingPackage, can't benullfeatureToSet-EStructuralFeaturefor settingPackage, can't benull- Returns:
- read
Package, nevernull - Throws:
XMLStreamException- if invalid xml structure was found
-
-