Class AbstractSchemaParser<T extends SchemaObject>

    • Field Detail

      • LOG

        protected static final Logger LOG
        The LoggerFactory used by this class
    • Constructor Detail

      • AbstractSchemaParser

        protected AbstractSchemaParser​(Class<T> schemaObjectType,
                                       I18n errorCodeOnNull,
                                       I18n errorCodeOnParseExceptionWithPosition,
                                       I18n errorCodeOnParseException)
        Instantiates a new abstract schema parser.
        Parameters:
        schemaObjectType - The Schema object type
        errorCodeOnNull - error code used when schema element is null
        errorCodeOnParseExceptionWithPosition - error code used on parse error when position is known
        errorCodeOnParseException - error code used on parse error when position is unknown
    • Method Detail

      • setQuirksMode

        public void setQuirksMode​(boolean enabled)
        Sets the quirks mode. If enabled the parser accepts non-numeric OIDs and some special characters in descriptions.
        Parameters:
        enabled - the new quirks mode
      • isQuirksMode

        public boolean isQuirksMode()
        Checks if quirks mode is enabled.
        Returns:
        true, if is quirks mode is enabled
      • parse

        public abstract T parse​(String schemaDescription)
                         throws ParseException
        Parse a SchemaObject description and returns back an instance of SchemaObject.
        Parameters:
        schemaDescription - The SchemaObject description
        Returns:
        A SchemaObject instance
        Throws:
        ParseException - If the parsing failed
      • updateSchemaName

        protected void updateSchemaName​(SchemaObject schemaObject)
        Update the schemaName for the given SchemaObject, accordingly to the X-SCHEMA parameter. If not present, default to 'other'
        Parameters:
        schemaObject - the schema object where the name should be updated