Class SchemaParser


  • public final class SchemaParser
    extends java.lang.Object
    Encapsulates a SchemaFunction and exposes a convenience static method for parsing schema definitions. The schema function used by this class can be set using the system property SCHEMA_FUNCTION_PROPERTY.
    Author:
    Middleware Services
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SchemaFunction getSchemaFunction()
      The SCHEMA_FUNCTION_PROPERTY property is checked and that class is loaded if provided.
      static <T extends SchemaElement>
      T
      parse​(java.lang.Class<T> type, java.lang.String definition)
      Parses the supplied string representation of a schema element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getSchemaFunction

        public static SchemaFunction getSchemaFunction()
        The SCHEMA_FUNCTION_PROPERTY property is checked and that class is loaded if provided. Otherwise the SchemaParser.DefaultSchemaFunction is returned.
        Returns:
        default filter function
      • parse

        public static <T extends SchemaElement> T parse​(java.lang.Class<T> type,
                                                        java.lang.String definition)
                                                 throws SchemaParseException
        Parses the supplied string representation of a schema element.
        Type Parameters:
        T - type of schema element
        Parameters:
        type - of schema element
        definition - to parse
        Returns:
        parsed schema element
        Throws:
        SchemaParseException - if definition is invalid