Class AbstractXdtoSerializer
- java.lang.Object
-
- com._1c.g5.v8.dt.xdto.model.resource.AbstractXdtoSerializer
-
- Direct Known Subclasses:
XdtoSerializer,XdtoToXsdSerializer
public class AbstractXdtoSerializer extends Object
Provides common infrastructure for serialization/deserialization Xdto content to different format
-
-
Field Summary
Fields Modifier and Type Field Description static StringABSTRACTstatic StringBASEstatic StringDEFAULTstatic StringENCODINGstatic StringENUMERATIONstatic StringFIXEDstatic StringFORMstatic StringFRACTION_DIGITSstatic StringIMPORTstatic StringITEM_TYPEstatic StringLENGTHstatic StringMAX_EXCLUSIVEstatic StringMAX_INCLUSIVEstatic StringMAX_LENGTHstatic StringMIN_EXCLUSIVEstatic StringMIN_INCLUSIVEstatic StringMIN_LENGTHstatic StringMIXEDstatic StringNAMEstatic StringNAMESPACEstatic StringNILLABLEstatic StringOPENstatic StringPATTERNstatic StringREFstatic StringSCHEMA_LOCATIONstatic StringTARGET_NAMESPACEstatic StringTOTAL_DIGITSstatic StringTYPEstatic StringWHITESPACEstatic StringXMLNS_PREFIXstatic StringXS_PREFIXstatic StringXS_URI
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractXdtoSerializer(String lineSeparator)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconvertLineEndings(ByteArrayOutputStream os, OutputStream outputStream)Changes line endings of the xml file content.protected StringcreateAttributeName(String prefix, String localName)Creates attribute name with prefixprotected voiddecreaceIndent()Decreases actual formatting indentationprotected StringgetNewPrefix(String uri, XMLStreamWriter writer)Computes new prefix foruri.protected voidincreaseIndent()Increases actual formatting indentationprotected voidwriteFormatCharacters(XMLStreamWriter writer)Writes formatting characters
-
-
-
Field Detail
-
ENCODING
public static final String ENCODING
- See Also:
- Constant Field Values
-
XMLNS_PREFIX
public static final String XMLNS_PREFIX
- See Also:
- Constant Field Values
-
XS_URI
public static final String XS_URI
- See Also:
- Constant Field Values
-
XS_PREFIX
public static final String XS_PREFIX
- See Also:
- Constant Field Values
-
TARGET_NAMESPACE
public static final String TARGET_NAMESPACE
- See Also:
- Constant Field Values
-
IMPORT
public static final String IMPORT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final String NAMESPACE
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
SCHEMA_LOCATION
public static final String SCHEMA_LOCATION
- See Also:
- Constant Field Values
-
REF
public static final String REF
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
DEFAULT
public static final String DEFAULT
- See Also:
- Constant Field Values
-
FIXED
public static final String FIXED
- See Also:
- Constant Field Values
-
NILLABLE
public static final String NILLABLE
- See Also:
- Constant Field Values
-
FORM
public static final String FORM
- See Also:
- Constant Field Values
-
BASE
public static final String BASE
- See Also:
- Constant Field Values
-
LENGTH
public static final String LENGTH
- See Also:
- Constant Field Values
-
MIN_LENGTH
public static final String MIN_LENGTH
- See Also:
- Constant Field Values
-
MAX_LENGTH
public static final String MAX_LENGTH
- See Also:
- Constant Field Values
-
WHITESPACE
public static final String WHITESPACE
- See Also:
- Constant Field Values
-
MIN_INCLUSIVE
public static final String MIN_INCLUSIVE
- See Also:
- Constant Field Values
-
MIN_EXCLUSIVE
public static final String MIN_EXCLUSIVE
- See Also:
- Constant Field Values
-
MAX_INCLUSIVE
public static final String MAX_INCLUSIVE
- See Also:
- Constant Field Values
-
MAX_EXCLUSIVE
public static final String MAX_EXCLUSIVE
- See Also:
- Constant Field Values
-
TOTAL_DIGITS
public static final String TOTAL_DIGITS
- See Also:
- Constant Field Values
-
FRACTION_DIGITS
public static final String FRACTION_DIGITS
- See Also:
- Constant Field Values
-
PATTERN
public static final String PATTERN
- See Also:
- Constant Field Values
-
ENUMERATION
public static final String ENUMERATION
- See Also:
- Constant Field Values
-
ABSTRACT
public static final String ABSTRACT
- See Also:
- Constant Field Values
-
MIXED
public static final String MIXED
- See Also:
- Constant Field Values
-
OPEN
public static final String OPEN
- See Also:
- Constant Field Values
-
ITEM_TYPE
public static final String ITEM_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractXdtoSerializer
protected AbstractXdtoSerializer(String lineSeparator)
Constructs a new instance.- Parameters:
lineSeparator- line separator to use, can't benull
-
-
Method Detail
-
getNewPrefix
protected String getNewPrefix(String uri, XMLStreamWriter writer) throws XMLStreamException
Computes new prefix foruri. Example: d1p2- Parameters:
uri- uri for creating prefix, can't benullwriter- actualXMLStreamWriter, can't benull- Returns:
- new prefix for
uri. Example: d1p2, nevernull - Throws:
XMLStreamException- if creating prefix is not valid for currentXMLStreamWriter
-
decreaceIndent
protected void decreaceIndent()
Decreases actual formatting indentation
-
increaseIndent
protected void increaseIndent()
Increases actual formatting indentation
-
createAttributeName
protected String createAttributeName(String prefix, String localName)
Creates attribute name with prefix- Parameters:
prefix- prefix for creating attribute name, can't benull. If prefix equals to "xmlns" it isn't writtenlocalName- name of the attribute, can't benull- Returns:
- creating attribute name, never
null
-
writeFormatCharacters
protected void writeFormatCharacters(XMLStreamWriter writer) throws XMLStreamException
Writes formatting characters- Parameters:
writer-XMLStreamWriterfor writing formatting characters- Throws:
XMLStreamException- when xml errors were occurred
-
convertLineEndings
protected void convertLineEndings(ByteArrayOutputStream os, OutputStream outputStream) throws IOException
Changes line endings of the xml file content. Changes " " to "\r"- Parameters:
os- stream with original xml content, can't benulloutputStream- stream for writing converting content, can't benull- Throws:
IOException- if I/O exception was occurred
-
-