Class BaseEnumXmlPartReader
- java.lang.Object
-
- com._1c.g5.v8.dt.import_.xml.reader.AbstractXmlPartReader
-
- com._1c.g5.v8.dt.import_.xml.reader.BaseEnumXmlPartReader
-
- All Implemented Interfaces:
IXmlPartReader
- Direct Known Subclasses:
ApplicationUsePurposeReader
,ChartLabelLocationPartReader
,ChartPlotAreaPlacementPartReader
,CompatibilityModeEnumXmlPartReader
,FormChildrenAlignXmlReader
,InterfaceCompatibilityModeEnumXmlPartReader
,LogFormElementHeightControlVariantXmlReader
,LogFormTableHeightControlVariantXmlReader
,RequiredMobileApplicationPermissionsEnumXmlPartReader
,TransactionsIsolationLevelEnumXmlPartReader
public class BaseEnumXmlPartReader extends AbstractXmlPartReader
Base enumeration XML readerThis class may be subclassed by custom enumeration readers
-
-
Field Summary
-
Fields inherited from class com._1c.g5.v8.dt.import_.xml.reader.AbstractXmlPartReader
xmlReadHelper
-
Fields inherited from interface com._1c.g5.v8.dt.import_.xml.reader.IXmlPartReader
XML_PART_READERS
-
-
Constructor Summary
Constructors Constructor Description BaseEnumXmlPartReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
read(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EStructuralFeature feature, IXmlNode node, String attributeName, Version version, IXmlReadErrorCollector errorCollector)
Read and convert node named attribute content to value in context-feature.protected Object
valueFromString(org.eclipse.emf.ecore.EAttribute feature, String value, Version version, IXmlReadErrorCollector errorCollector)
Convert string value to enum value.-
Methods inherited from class com._1c.g5.v8.dt.import_.xml.reader.AbstractXmlPartReader
getWrongAttributeValueMessage, getXmlElementRequiredMessage, read, setRefers, setValue
-
-
-
-
Method Detail
-
read
public void read(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EStructuralFeature feature, IXmlNode node, String attributeName, Version version, IXmlReadErrorCollector errorCollector)
Description copied from interface:IXmlPartReader
Read and convert node named attribute content to value in context-feature.- Parameters:
context
- the contextEObject
, cannot benull
feature
- theEStructuralFeature
, cannot benull
node
- the sourceIXmlNode
, cannot benull
attributeName
- the name of attribute to set as value in model, ornull
to use text from nodeversion
- the version of importing 1C:Enterprise XML files, cannot benull
errorCollector
- theIXmlReadErrorCollector
to add occurred errors
-
valueFromString
protected Object valueFromString(org.eclipse.emf.ecore.EAttribute feature, String value, Version version, IXmlReadErrorCollector errorCollector)
Convert string value to enum value.Tries to get Enum as literal from given string value or from given string value with capital letter
- Parameters:
feature
- the Enum typeEAttribute
, cannot benull
value
- string text value of readed enum, can benull
version
- the version of importing 1C:Enterprise XML files, cannot benull
errorCollector
-IXmlReadErrorCollector
in which will be added error if it occur, cannot benull
- Returns:
- instance of enumerator, never
null
- Throws:
IllegalArgumentException
- if the value is not a valid for enumerator in feature type
-
-