Package com._1c.g5.v8.dt.dcs.util
Class V8XmlSerializer
- java.lang.Object
-
- com._1c.g5.v8.dt.dcs.util.V8XmlSerializer
-
public class V8XmlSerializer extends Object
Сериализатор/десериализатор в платформенный xml (общие функции)
-
-
Field Summary
Fields Modifier and Type Field Description static String
CHM_XML_NAMESPACE
static String
CHM_XML_NAMESPACE_PREFIX
static String
CUR_XML_NAMESPACE
static String
ENT_XML_NAMESPACE
static String
ENT_XML_NAMESPACE_PREFIX
static String
INSTANCE_XML_NAMESPACE
static String
INSTANCE_XML_NAMESPACE_PREFIX
static String
STYLE_OBJECT_NAME_PREFIX
static String
STYLE_XML_NAMESPACE
static String
STYLE_XML_NAMESPACE_PREFIX
static String
SYS_XML_NAMESPACE
static String
SYS_XML_NAMESPACE_PREFIX
static String
SYSTEM_OBJECT_NAME_PREFIX
static String
V8_XML_NAMESPACE
static String
V8_XML_NAMESPACE_PREFIX
static String
V8TYPES_XML_NAMESPACE
static String
V8UI_XML_NAMESPACE
static String
V8UI_XML_NAMESPACE_PREFIX
static String
WEB_OBJECT_NAME_PREFIX
static String
WEB_XML_NAMESPACE
static String
WEB_XML_NAMESPACE_PREFIX
static String
WIN_XML_NAMESPACE
static String
WIN_XML_NAMESPACE_PREFIX
static String
WINDOWS_OBJECT_NAME_PREFIX
static String
XML_NAMESPACE
static String
XML_NAMESPACE_PREFIX
-
Constructor Summary
Constructors Constructor Description V8XmlSerializer()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
getContentTillEndElement(XMLStreamReader reader)
Skips content till end element and returns inner content as stringstatic boolean
isValueNullOrDefault(Object value)
Check if value is null of equals default value Default value is created by valuestatic boolean
isValueNullOrDefault(Object value, Object defaultValue)
Check if value is null of equals default valuestatic QName
parseFullName(XMLStreamReader reader, String fullName)
GetsQName
from string with full namestatic Structure
readAdditionalProperties(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes)
ReadStructure
from xmlstatic BinaryQualifiers
readBinaryDataQualifiers(XMLStreamReader reader)
Прочитать квалификаторы двоичных данныхstatic boolean
readBoolean(XMLStreamReader reader)
Прочитать значение типа булевоstatic Border
readBorder(XMLStreamReader reader, IDtProject dtProject, Version version)
Reads border valuestatic Color
readColor(XMLStreamReader reader, IDtProject dtProject, Version version)
ReadsColor
from xml.static Date
readDate(XMLStreamReader reader)
Прочитать значение типа датаstatic DateQualifiers
readDateQualifiers(XMLStreamReader reader)
Прочитать квалификаторы датыstatic <T> T
readEnum(Class<T> enumClass, XMLStreamReader reader)
Прочитать значение перечисленияstatic Font
readFont(XMLStreamReader reader, IDtProject dtProject, Version version)
Прочитать значение типа шрифтstatic GaugeChartQualityBand
readGaugeChartQualityBand(XMLStreamReader reader, IDtProject dtProject, Version version)
Прочитать значение типа полоса для измерительной диаграммыstatic GaugeChartQualityBands
readGaugeChartQualityBands(XMLStreamReader reader, IDtProject dtProject, Version version)
Прочитать значение типа полосы для измерительной диаграммыstatic int
readInteger(XMLStreamReader reader)
Прочитать значение типа числоstatic Line
readLine(XMLStreamReader reader, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Прочитать значение типа линияstatic void
readLocalStringMap(XMLStreamReader reader, org.eclipse.emf.common.util.EMap<String,String> localStringMap)
Прочитать локализованную строкуstatic NumberQualifiers
readNumberQualifiers(XMLStreamReader reader)
Прочитать квалификаторы числаstatic Picture
readPicture(XMLStreamReader streamReader, IDtProject dtProject, Version version)
Read picture value.static StandardBeginningDate
readStandardBeginningDate(XMLStreamReader reader)
Read StandardBeginningDatestatic StandardPeriod
readStandardPeriod(XMLStreamReader reader)
Read StandardPeriodstatic String
readString(XMLStreamReader reader)
Прочитать значение типа строкаstatic StringQualifiers
readStringQualifiers(XMLStreamReader reader)
Прочитать квалификаторы строкиstatic QName
readType(XMLStreamReader reader)
Прочитать тип элементаstatic TypeDescription
readTypeDescription(XMLStreamReader reader, IDtProject dtProject, Map<UUID,TypeItem> definedTypes)
Read TypeDescriptionstatic Value
readValue(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes)
Read the value of general typestatic TypedValueList
readValueList(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes)
Read ValueListTypestatic TypedValueListItem
readValueListItem(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes)
Read ValueListItemTypestatic void
skipTillEndElement(XMLStreamReader reader)
Пропустить все содержимое до конца элементаstatic void
throwWrongElement(XMLStreamReader reader)
Сгенерировать исключение об ошибкеstatic void
writeAdditionalProperties(ExportXmlStreamWriter writer, Structure structure, Map<String,UUID> definedTypes)
WriteStructure
to xmlstatic void
writeBinaryQualifiers(ExportXmlStreamWriter writer, BinaryQualifiers qualifiers)
Записать квалификаторы двоичных данныхstatic void
writeBoolean(ExportXmlStreamWriter writer, Boolean value, QName elementName)
Записать значение типа булевоstatic void
writeBooleanNotDefault(ExportXmlStreamWriter writer, Boolean value, Boolean defaultValue, QName elementName)
Write not default Boolean valuestatic void
writeBorder(ExportXmlStreamWriter writer, Border border, QName elementName)
Writes border value with given element name.static void
writeColor(ExportXmlStreamWriter writer, Color color, QName elementName)
Записать значение типа цветstatic void
writeDate(ExportXmlStreamWriter writer, Date value, QName elementName)
Записать значение типа датаstatic void
writeDateNotDefault(ExportXmlStreamWriter writer, Date value, Date defaultValue, QName elementName)
Write not default Date valuestatic void
writeDateQualifiers(ExportXmlStreamWriter writer, DateQualifiers qualifiers)
Записать квалификаторы датыstatic void
writeEmptyElement(ExportXmlStreamWriter writer, QName elementName)
Writes empty element.static void
writeEndElement(ExportXmlStreamWriter writer, QName elementName)
Записать конец элементаstatic <T> void
writeEnum(ExportXmlStreamWriter writer, T value, QName elementName)
Записать значение перечисленияstatic <T> void
writeEnumNotDefault(ExportXmlStreamWriter writer, T value, T defaulValue, QName elementName)
Write not default value of enumstatic void
writeFont(ExportXmlStreamWriter writer, Font font, QName elementName)
Записать значение типа шрифтstatic void
writeGaugeChartQualityBand(ExportXmlStreamWriter writer, GaugeChartQualityBand band, QName elementName)
Записать значение типа полоса для измерительной диаграммыstatic void
writeGaugeChartQualityBands(ExportXmlStreamWriter writer, GaugeChartQualityBands bands, QName elementName)
Записать значение типа полосы для измерительной диаграммыstatic void
writeInlineEndElement(ExportXmlStreamWriter writer, QName elementName)
Записать конец элемента на той же строкеstatic void
writeInteger(ExportXmlStreamWriter writer, Integer value, QName elementName)
Записать значение типа числоstatic void
writeIntegerNotDefault(ExportXmlStreamWriter writer, Integer value, Integer defaultValue, QName elementName)
Write not default Integer valuestatic void
writeLocalStringMap(ExportXmlStreamWriter writer, org.eclipse.emf.common.util.EMap<String,String> localStringMap, QName elementName)
Записать локализованную строкуstatic void
writeNumberQualifiers(ExportXmlStreamWriter writer, NumberQualifiers qualifiers)
Записать квалификаторы числаstatic void
writePicture(ExportXmlStreamWriter streamWriter, Picture value, QName elementName)
Write picture value.static void
writeStandardBeginningDate(ExportXmlStreamWriter writer, StandardBeginningDate stdBegDate, QName elementName)
Write StandardBeginningDatestatic void
writeStandardPeriod(ExportXmlStreamWriter writer, StandardPeriod stdPeriod, QName elementName)
Write StandardPeriodstatic void
writeStartElement(ExportXmlStreamWriter writer, QName elementName)
Записать начало элементаstatic void
writeString(ExportXmlStreamWriter writer, String value, QName elementName)
Записать значение типа строкаstatic void
writeStringNotDefault(ExportXmlStreamWriter writer, String value, String defaultValue, QName elementName)
Write not default String valuestatic void
writeStringQualifiers(ExportXmlStreamWriter writer, StringQualifiers qualifiers)
Записать квалификаторы строкиstatic void
writeType(ExportXmlStreamWriter writer, QName typeName)
Записать тип элементаstatic void
writeTypeDescription(ExportXmlStreamWriter writer, TypeDescription type, QName elementName)
Deprecated.static void
writeTypeDescription(ExportXmlStreamWriter writer, TypeDescription type, QName elementName, Map<String,UUID> definedTypes)
Записать описание типаstatic boolean
writeValue(ExportXmlStreamWriter writer, Value value, QName elementName, Map<String,UUID> definedTypes)
Записать значение общего типаstatic void
writeValueList(ExportXmlStreamWriter writer, TypedValueList valueList, QName elementName, Map<String,UUID> definedTypes)
Write ValueListTypestatic void
writeValueListItem(ExportXmlStreamWriter writer, TypedValueListItem item, QName elementName, Map<String,UUID> definedTypes)
Write ValueListItemType
-
-
-
Field Detail
-
INSTANCE_XML_NAMESPACE
public static final String INSTANCE_XML_NAMESPACE
- See Also:
- Constant Field Values
-
XML_NAMESPACE
public static final String XML_NAMESPACE
- See Also:
- Constant Field Values
-
V8_XML_NAMESPACE
public static final String V8_XML_NAMESPACE
- See Also:
- Constant Field Values
-
V8UI_XML_NAMESPACE
public static final String V8UI_XML_NAMESPACE
- See Also:
- Constant Field Values
-
WEB_XML_NAMESPACE
public static final String WEB_XML_NAMESPACE
- See Also:
- Constant Field Values
-
WIN_XML_NAMESPACE
public static final String WIN_XML_NAMESPACE
- See Also:
- Constant Field Values
-
STYLE_XML_NAMESPACE
public static final String STYLE_XML_NAMESPACE
- See Also:
- Constant Field Values
-
SYS_XML_NAMESPACE
public static final String SYS_XML_NAMESPACE
- See Also:
- Constant Field Values
-
WEB_OBJECT_NAME_PREFIX
public static final String WEB_OBJECT_NAME_PREFIX
- See Also:
- Constant Field Values
-
SYSTEM_OBJECT_NAME_PREFIX
public static final String SYSTEM_OBJECT_NAME_PREFIX
- See Also:
- Constant Field Values
-
STYLE_OBJECT_NAME_PREFIX
public static final String STYLE_OBJECT_NAME_PREFIX
- See Also:
- Constant Field Values
-
WINDOWS_OBJECT_NAME_PREFIX
public static final String WINDOWS_OBJECT_NAME_PREFIX
- See Also:
- Constant Field Values
-
ENT_XML_NAMESPACE
public static final String ENT_XML_NAMESPACE
- See Also:
- Constant Field Values
-
CHM_XML_NAMESPACE
public static final String CHM_XML_NAMESPACE
- See Also:
- Constant Field Values
-
CUR_XML_NAMESPACE
public static final String CUR_XML_NAMESPACE
- See Also:
- Constant Field Values
-
V8TYPES_XML_NAMESPACE
public static final String V8TYPES_XML_NAMESPACE
- See Also:
- Constant Field Values
-
INSTANCE_XML_NAMESPACE_PREFIX
public static final String INSTANCE_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
XML_NAMESPACE_PREFIX
public static final String XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
V8_XML_NAMESPACE_PREFIX
public static final String V8_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
V8UI_XML_NAMESPACE_PREFIX
public static final String V8UI_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
WEB_XML_NAMESPACE_PREFIX
public static final String WEB_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
WIN_XML_NAMESPACE_PREFIX
public static final String WIN_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
STYLE_XML_NAMESPACE_PREFIX
public static final String STYLE_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
SYS_XML_NAMESPACE_PREFIX
public static final String SYS_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
ENT_XML_NAMESPACE_PREFIX
public static final String ENT_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
CHM_XML_NAMESPACE_PREFIX
public static final String CHM_XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
readInteger
public static int readInteger(XMLStreamReader reader) throws XMLStreamException
Прочитать значение типа число- Parameters:
reader
-- Returns:
- значение
- Throws:
XMLStreamException
-
writeInteger
public static void writeInteger(ExportXmlStreamWriter writer, Integer value, QName elementName) throws XMLStreamException
Записать значение типа число- Parameters:
writer
-value
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
-
writeIntegerNotDefault
public static void writeIntegerNotDefault(ExportXmlStreamWriter writer, Integer value, Integer defaultValue, QName elementName) throws XMLStreamException
Write not default Integer value- Parameters:
writer
-value
- valuedefaulValue
- default valueelementName
- xml element name- Throws:
XMLStreamException
-
readString
public static String readString(XMLStreamReader reader) throws XMLStreamException
Прочитать значение типа строка- Parameters:
reader
-- Returns:
- значение
- Throws:
XMLStreamException
-
writeString
public static void writeString(ExportXmlStreamWriter writer, String value, QName elementName) throws XMLStreamException
Записать значение типа строка- Parameters:
writer
-value
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
-
writeStringNotDefault
public static void writeStringNotDefault(ExportXmlStreamWriter writer, String value, String defaultValue, QName elementName) throws XMLStreamException
Write not default String value- Parameters:
writer
-value
- valuedefaulValue
- default valueelementName
- xml element name- Throws:
XMLStreamException
-
readDate
public static Date readDate(XMLStreamReader reader) throws XMLStreamException
Прочитать значение типа дата- Parameters:
reader
-- Returns:
- значение
- Throws:
XMLStreamException
-
writeDate
public static void writeDate(ExportXmlStreamWriter writer, Date value, QName elementName) throws XMLStreamException
Записать значение типа дата- Parameters:
writer
-value
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
-
writeDateNotDefault
public static void writeDateNotDefault(ExportXmlStreamWriter writer, Date value, Date defaultValue, QName elementName) throws XMLStreamException
Write not default Date value- Parameters:
writer
-value
- valuedefaulValue
- default valueelementName
- xml element name- Throws:
XMLStreamException
-
readBoolean
public static boolean readBoolean(XMLStreamReader reader) throws XMLStreamException
Прочитать значение типа булево- Parameters:
reader
-- Returns:
- значение
- Throws:
XMLStreamException
-
writeBoolean
public static void writeBoolean(ExportXmlStreamWriter writer, Boolean value, QName elementName) throws XMLStreamException
Записать значение типа булево- Parameters:
writer
-value
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
-
writeBooleanNotDefault
public static void writeBooleanNotDefault(ExportXmlStreamWriter writer, Boolean value, Boolean defaultValue, QName elementName) throws XMLStreamException
Write not default Boolean value- Parameters:
writer
-value
- valuedefaulValue
- default valueelementName
- xml element name- Throws:
XMLStreamException
-
readStandardPeriod
public static StandardPeriod readStandardPeriod(XMLStreamReader reader) throws XMLStreamException
Read StandardPeriod- Parameters:
reader
- xml stream reader- Returns:
- value of
StandardPeriod
type - Throws:
XMLStreamException
-
writeStandardPeriod
public static void writeStandardPeriod(ExportXmlStreamWriter writer, StandardPeriod stdPeriod, QName elementName) throws XMLStreamException, ExportException
Write StandardPeriod- Parameters:
writer
- xml stream writerstdPeriod
- value ofStandardPeriod
typeelementName
- qname of xml element- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readStandardBeginningDate
public static StandardBeginningDate readStandardBeginningDate(XMLStreamReader reader) throws XMLStreamException
Read StandardBeginningDate- Parameters:
reader
- xml stream reader- Returns:
- value of
StandardBeginningDate
type - Throws:
XMLStreamException
-
writeStandardBeginningDate
public static void writeStandardBeginningDate(ExportXmlStreamWriter writer, StandardBeginningDate stdBegDate, QName elementName) throws XMLStreamException, ExportException
Write StandardBeginningDate- Parameters:
writer
- xml stream writerstdBegDate
- value ofStandardBeginningDate
typeelementName
- qname of xml element- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readValueListItem
public static TypedValueListItem readValueListItem(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes) throws XMLStreamException
Read ValueListItemType- Parameters:
reader
-XMLStreamReader
xml stream reader, can't benull
dtProject
- the targetIDtProject
, can't benull
version
- The platform version. May not benull
definedTypes
- map of defined types, can't benull
- Returns:
- value of
ValueListItemType
type, never null - Throws:
XMLStreamException
-
writeValueListItem
public static void writeValueListItem(ExportXmlStreamWriter writer, TypedValueListItem item, QName elementName, Map<String,UUID> definedTypes) throws XMLStreamException, ExportException
Write ValueListItemType- Parameters:
writer
- xml stream writeritem
- value ofValueListItemType
typeelementName
- qname of xml element- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readValueList
public static TypedValueList readValueList(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes) throws XMLStreamException
Read ValueListType- Parameters:
reader
-XMLStreamReader
xml stream reader, can't benull
dtProject
- the targetIDtProject
, can't benull
version
- The platform version. May not benull
definedTypes
- map of defined types, can't benull
- Returns:
- value of
ValueListType
type, nevernull
- Throws:
XMLStreamException
-
writeValueList
public static void writeValueList(ExportXmlStreamWriter writer, TypedValueList valueList, QName elementName, Map<String,UUID> definedTypes) throws XMLStreamException, ExportException
Write ValueListType- Parameters:
writer
- xml stream writervalueList
- value ofValueListType
typeelementName
- qname of xml elementtypes
- map of current configuration types- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readValue
public static Value readValue(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes) throws XMLStreamException
Read the value of general type- Parameters:
reader
-XMLStreamReader
xml stream reader, can't benull
dtProject
- the targetIDtProject
, can't benull
version
- The platform version. May not benull
definedTypes
- map of defined types, can't benull
- Returns:
Value
ornull
in case of inappropriate value type- Throws:
XMLStreamException
-
writeBorder
public static void writeBorder(ExportXmlStreamWriter writer, Border border, QName elementName) throws XMLStreamException, ExportException
Writes border value with given element name.- Parameters:
writer
- xml writer, notnull
border
- border to write to xml, notnull
elementName
- element name to write border value into, notnull
- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readBorder
public static Border readBorder(XMLStreamReader reader, IDtProject dtProject, Version version) throws XMLStreamException
Reads border value- Parameters:
reader
- xml reader, notnull
resource
- resource which contains, notnull
version
- The platform version. May not benull
- Returns:
- border value, may be
null
- Throws:
XMLStreamException
-
writeValue
public static boolean writeValue(ExportXmlStreamWriter writer, Value value, QName elementName, Map<String,UUID> definedTypes) throws XMLStreamException, ExportException
Записать значение общего типа- Parameters:
writer
-value
- значениеelementName
- имя элемента xml- Returns:
- записано или нет
- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readGaugeChartQualityBands
public static GaugeChartQualityBands readGaugeChartQualityBands(XMLStreamReader reader, IDtProject dtProject, Version version) throws XMLStreamException
Прочитать значение типа полосы для измерительной диаграммы- Parameters:
reader
-resource
- ресурсversion
- The platform version. May not benull
- Returns:
- значение
- Throws:
XMLStreamException
-
writeGaugeChartQualityBands
public static void writeGaugeChartQualityBands(ExportXmlStreamWriter writer, GaugeChartQualityBands bands, QName elementName) throws XMLStreamException, ExportException
Записать значение типа полосы для измерительной диаграммы- Parameters:
writer
-bands
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readGaugeChartQualityBand
public static GaugeChartQualityBand readGaugeChartQualityBand(XMLStreamReader reader, IDtProject dtProject, Version version) throws XMLStreamException
Прочитать значение типа полоса для измерительной диаграммы- Parameters:
reader
-resource
- ресурсversion
- The platform version. May not benull
- Returns:
- значение
- Throws:
XMLStreamException
-
writeGaugeChartQualityBand
public static void writeGaugeChartQualityBand(ExportXmlStreamWriter writer, GaugeChartQualityBand band, QName elementName) throws XMLStreamException, ExportException
Записать значение типа полоса для измерительной диаграммы- Parameters:
writer
-band
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readColor
public static Color readColor(XMLStreamReader reader, IDtProject dtProject, Version version) throws XMLStreamException
ReadsColor
from xml.- Parameters:
reader
- theXMLStreamReader
, cannot benull
resource
- the resource, cannot benull
version
- The platform version. May not benull
- Returns:
- the
Color
instance, can benull
- Throws:
XMLStreamException
-
writeColor
public static void writeColor(ExportXmlStreamWriter writer, Color color, QName elementName) throws XMLStreamException, ExportException
Записать значение типа цвет- Parameters:
writer
-color
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readPicture
public static Picture readPicture(XMLStreamReader streamReader, IDtProject dtProject, Version version) throws XMLStreamException
Read picture value.- Parameters:
streamReader
- instance ofXMLStreamReader
, must not benull
resource
-Resource
, must not benull
version
- The platform version. May not benull
- Returns:
- instance of
Picture
, nevernull
- Throws:
XMLStreamException
-
writePicture
public static void writePicture(ExportXmlStreamWriter streamWriter, Picture value, QName elementName) throws XMLStreamException, ExportException
Write picture value.- Parameters:
streamWriter
- instance ofExportXmlStreamWriter
, must not benull
value
- picture to write. In case ofnull
value nothing is written.elementName
- xml element name, must not benull
- Throws:
XMLStreamException
ExportException
-
readFont
public static Font readFont(XMLStreamReader reader, IDtProject dtProject, Version version) throws XMLStreamException
Прочитать значение типа шрифт- Parameters:
reader
-resource
- ресурсversion
- The platform version. May not benull
- Returns:
- значение
- Throws:
XMLStreamException
-
writeFont
public static void writeFont(ExportXmlStreamWriter writer, Font font, QName elementName) throws XMLStreamException, ExportException
Записать значение типа шрифт- Parameters:
writer
-font
- значениеelementName
- имя элемента xml- Throws:
XMLStreamException
ExportException
- Exception
-
readLine
public static Line readLine(XMLStreamReader reader, org.eclipse.emf.ecore.resource.ResourceSet resourceSet) throws XMLStreamException
Прочитать значение типа линия- Parameters:
reader
-resourceSet
- ресурсы- Returns:
- значение
- Throws:
XMLStreamException
-
writeTypeDescription
@Deprecated public static void writeTypeDescription(ExportXmlStreamWriter writer, TypeDescription type, QName elementName) throws XMLStreamException
Deprecated.Записать описание типа- Parameters:
writer
-type
- описание типаelementName
- имя элемента xml- Throws:
XMLStreamException
-
readTypeDescription
public static TypeDescription readTypeDescription(XMLStreamReader reader, IDtProject dtProject, Map<UUID,TypeItem> definedTypes) throws XMLStreamException
Read TypeDescription- Parameters:
reader
-XMLStreamReader
xml stream reader, can't benull
resource
-Resource
resource, can't benull
types
- map of current configuration types, can't benull
definedTypes
- map of defined types, can't benull
- Returns:
TypeDescription
type, nevernull
- Throws:
XMLStreamException
-
writeTypeDescription
public static void writeTypeDescription(ExportXmlStreamWriter writer, TypeDescription type, QName elementName, Map<String,UUID> definedTypes) throws XMLStreamException
Записать описание типа- Parameters:
writer
-type
- описание типаelementName
- имя элемента xmltypes
- существующие типы- Throws:
XMLStreamException
-
readNumberQualifiers
public static NumberQualifiers readNumberQualifiers(XMLStreamReader reader) throws XMLStreamException
Прочитать квалификаторы числа- Parameters:
reader
-- Returns:
- квалификаторы
- Throws:
XMLStreamException
-
writeNumberQualifiers
public static void writeNumberQualifiers(ExportXmlStreamWriter writer, NumberQualifiers qualifiers) throws XMLStreamException
Записать квалификаторы числа- Parameters:
writer
-qualifiers
- квалификаторы- Throws:
XMLStreamException
-
readStringQualifiers
public static StringQualifiers readStringQualifiers(XMLStreamReader reader) throws XMLStreamException
Прочитать квалификаторы строки- Parameters:
reader
-- Returns:
- квалификаторы
- Throws:
XMLStreamException
-
writeStringQualifiers
public static void writeStringQualifiers(ExportXmlStreamWriter writer, StringQualifiers qualifiers) throws XMLStreamException
Записать квалификаторы строки- Parameters:
writer
-qualifiers
- квалификаторы- Throws:
XMLStreamException
-
readDateQualifiers
public static DateQualifiers readDateQualifiers(XMLStreamReader reader) throws XMLStreamException
Прочитать квалификаторы даты- Parameters:
reader
-- Returns:
- квалификаторы
- Throws:
XMLStreamException
-
writeDateQualifiers
public static void writeDateQualifiers(ExportXmlStreamWriter writer, DateQualifiers qualifiers) throws XMLStreamException
Записать квалификаторы даты- Parameters:
writer
-qualifiers
- квалификаторы- Throws:
XMLStreamException
-
readBinaryDataQualifiers
public static BinaryQualifiers readBinaryDataQualifiers(XMLStreamReader reader) throws XMLStreamException
Прочитать квалификаторы двоичных данных- Parameters:
reader
-- Returns:
- квалификаторы
- Throws:
XMLStreamException
-
writeBinaryQualifiers
public static void writeBinaryQualifiers(ExportXmlStreamWriter writer, BinaryQualifiers qualifiers) throws XMLStreamException
Записать квалификаторы двоичных данных- Parameters:
writer
-qualifiers
- квалификаторы- Throws:
XMLStreamException
-
readLocalStringMap
public static void readLocalStringMap(XMLStreamReader reader, org.eclipse.emf.common.util.EMap<String,String> localStringMap) throws XMLStreamException
Прочитать локализованную строку- Parameters:
reader
-- Throws:
XMLStreamException
-
writeLocalStringMap
public static void writeLocalStringMap(ExportXmlStreamWriter writer, org.eclipse.emf.common.util.EMap<String,String> localStringMap, QName elementName) throws XMLStreamException, ExportException
Записать локализованную строку- Parameters:
writer
-localString
- строкаelementName
- имя элемента xml- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readType
public static QName readType(XMLStreamReader reader)
Прочитать тип элемента- Parameters:
reader
-- Returns:
- тип
-
writeType
public static void writeType(ExportXmlStreamWriter writer, QName typeName) throws XMLStreamException, ExportException
Записать тип элемента- Parameters:
writer
-typeName
- тип- Throws:
XMLStreamException
ExportException
- if export processing errors
-
readEnum
public static <T> T readEnum(Class<T> enumClass, XMLStreamReader reader) throws XMLStreamException
Прочитать значение перечисления- Parameters:
enumClass
- класс перечисленияreader
-- Returns:
- значение перечисления
- Throws:
XMLStreamException
-
writeEnum
public static <T> void writeEnum(ExportXmlStreamWriter writer, T value, QName elementName) throws XMLStreamException
Записать значение перечисления- Parameters:
writer
-value
- значение перечисленияelementName
- имя элемента xml- Throws:
XMLStreamException
-
writeEnumNotDefault
public static <T> void writeEnumNotDefault(ExportXmlStreamWriter writer, T value, T defaulValue, QName elementName) throws XMLStreamException
Write not default value of enum- Parameters:
writer
-value
- valuedefaulValue
- default valueelementName
- xml element name- Throws:
XMLStreamException
-
writeStartElement
public static void writeStartElement(ExportXmlStreamWriter writer, QName elementName) throws XMLStreamException
Записать начало элемента- Parameters:
writer
-elementName
- имя элемента xml- Throws:
XMLStreamException
-
writeEmptyElement
public static void writeEmptyElement(ExportXmlStreamWriter writer, QName elementName) throws XMLStreamException
Writes empty element.- Parameters:
writer
- the writer, cannot benull
elementName
- the element name, can benull
- Throws:
XMLStreamException
- the XML stream exception
-
writeEndElement
public static void writeEndElement(ExportXmlStreamWriter writer, QName elementName) throws XMLStreamException
Записать конец элемента- Parameters:
writer
-elementName
- имя элемента xml- Throws:
XMLStreamException
-
writeInlineEndElement
public static void writeInlineEndElement(ExportXmlStreamWriter writer, QName elementName) throws XMLStreamException
Записать конец элемента на той же строке- Parameters:
writer
-elementName
- имя элемента xml- Throws:
XMLStreamException
-
skipTillEndElement
public static void skipTillEndElement(XMLStreamReader reader) throws XMLStreamException
Пропустить все содержимое до конца элемента- Parameters:
reader
-- Throws:
XMLStreamException
-
throwWrongElement
public static void throwWrongElement(XMLStreamReader reader) throws XMLStreamException
Сгенерировать исключение об ошибке- Parameters:
reader
-- Throws:
XMLStreamException
-
isValueNullOrDefault
public static boolean isValueNullOrDefault(Object value)
Check if value is null of equals default value Default value is created by value- Parameters:
value
- value- Returns:
-
isValueNullOrDefault
public static boolean isValueNullOrDefault(Object value, Object defaultValue)
Check if value is null of equals default value- Parameters:
value
- valuedefaultValue
- defult value- Returns:
-
parseFullName
public static QName parseFullName(XMLStreamReader reader, String fullName)
GetsQName
from string with full name- Parameters:
reader
- actualXMLStreamReader
, cannnot benull
fullName
- full name content, cannot benull
- Returns:
QName
from string with full name, nevernull
-
getContentTillEndElement
public static String getContentTillEndElement(XMLStreamReader reader) throws XMLStreamException
Skips content till end element and returns inner content as string- Parameters:
reader
- actualXMLStreamReader
, cannnot benull
- Returns:
- element content as string, never
null
- Throws:
XMLStreamException
-
writeAdditionalProperties
public static void writeAdditionalProperties(ExportXmlStreamWriter writer, Structure structure, Map<String,UUID> definedTypes) throws XMLStreamException, ExportException
WriteStructure
to xml- Parameters:
writer
- instance ofExportXmlStreamWriter
, must not benull
structure
-Structure
to write, cannot benull
- Throws:
XMLStreamException
ExportException
-
readAdditionalProperties
public static Structure readAdditionalProperties(XMLStreamReader reader, IDtProject dtProject, Version version, Map<UUID,TypeItem> definedTypes) throws XMLStreamException, ExportException
ReadStructure
from xml- Parameters:
reader
-XMLStreamReader
xml stream reader, can't benull
resource
-Resource
resource, can't benull
version
- The platform version. May not benull
definedTypes
- map of defined types, can't benull
- Returns:
- read
Structure
, nevernull
- Throws:
XMLStreamException
ExportException
-
-