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 Details

  • 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 to DefaultColumnDefinition.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 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 violated
      SchemaException
      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

      @NotNull public static SchemaXml transform​(@NotNull SchemaXml schema)
      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