Package com.illumon.iris.db.schema.xml
Class SchemaXmlUtil
java.lang.Object
com.illumon.iris.db.schema.xml.SchemaXmlUtil
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if twoSchemaXmlare equal according to the serialized output frommakeSchemaXmlOutputter().static booleanChecks if twoSchemaXmlare equal according to the serialized output fromoutputter.static intgetEncodingValue(org.jdom2.Element element) Get the encoding value for a string from an XML (Column) Element.static booleanisVarSizeString(org.jdom2.Element columnElement) Find out whether the column element is a var sized string.static org.jdom2.output.XMLOutputterThis defines the "official" format of new schema XML.static SchemaXmlRun 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
ColumnDefinitionenumeration 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 SchemaException Find 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
-
equals
Checks if twoSchemaXmlare equal according to the serialized output frommakeSchemaXmlOutputter().- Parameters:
left- the left Schemaright- the right Schema- Returns:
- if the Schemas are equal
-
equals
public static boolean equals(org.jdom2.output.XMLOutputter outputter, SchemaXml left, SchemaXml right) Checks if twoSchemaXmlare equal according to the serialized output fromoutputter.- Parameters:
outputter- the xml outputterleft- the left Schemaright- the right Schema- Returns:
- if the Schemas are equal
-