Package com.illumon.iris.db.schema.xml
Class SchemaXmlUtil
java.lang.Object
com.illumon.iris.db.schema.xml.SchemaXmlUtil
public class SchemaXmlUtil extends Object
Utilities for XML representation of a Schema.
This is really a few bits of logic that are currently shared because of direct XML use in LoggerListenerGenerationInfo.
-
Constructor Summary
Constructors Constructor Description SchemaXmlUtil()
-
Method Summary
Modifier and Type Method Description static int
getEncodingValue(org.jdom2.Element element)
Get the encoding value for a string from an XML (Column) Element.static boolean
isVarSizeString(org.jdom2.Element columnElement)
Find out whether the column element is a var sized string.static org.jdom2.output.XMLOutputter
makeSchemaXmlOutputter()
This defines the "official" format of new schema XML.static SchemaXml
transform(SchemaXml schema)
Run xml read from disk through a formatter to normalize the representation.
-
Constructor Details
-
SchemaXmlUtil
public SchemaXmlUtil()
-
-
Method Details
-
getEncodingValue
public static int getEncodingValue(@NotNull org.jdom2.Element element)Get the encoding value for a string from an XML (Column) Element. Defaults toDefaultColumnDefinition.ENCODING_ISO_8859_1
.- Parameters:
element
- the XML element to retrieve the encoding from- Returns:
- the
ColumnDefinition
enumeration ordinal for this encoding - ApiNote:
- This is part of the internal Deephaven API and is subject to change.
-
isVarSizeString
public static boolean isVarSizeString(@NotNull org.jdom2.Element columnElement) throws SchemaExceptionFind out whether the column element is a var sized string. Does validation on XML rules as a side effect.- Parameters:
columnElement
- the element which may be a var size string- Returns:
- true if this element is a var sized string (meaning it should not use a symbol table)
- Throws:
SchemaValidationException
- if certain XML rules are violatedSchemaException
- ApiNote:
- This is part of the internal Deephaven API and is subject to change.
-
makeSchemaXmlOutputter
public static org.jdom2.output.XMLOutputter makeSchemaXmlOutputter()This defines the "official" format of new schema XML. XMLOutputter is final, so make a factory instead of derived class.- Returns:
- an XMLOutputter configured for the official schema format.
-
transform
Run xml read from disk through a formatter to normalize the representation. This happens in the kv store SchemaService implementations, and the transient implementations need to do this to be consistent.- Parameters:
schema
- the input schema- Returns:
- a schema built from normalized schema xml
-