Class AttributeParser

java.lang.Object
org.jboss.as.controller.AttributeParser
Direct Known Subclasses:
AttributeParser.DiscardOldDefaultValueParser, AttributeParsers.AttributeElementParser, AttributeParsers.MapParser, AttributeParsers.ObjectParser, AttributeParsers.WrappedObjectListParser

public abstract class AttributeParser extends Object
Author:
Tomaz Cerar (c) 2014 Red Hat Inc.
  • Field Details

    • SIMPLE

      public static final AttributeParser SIMPLE
    • STRING_LIST

      public static final AttributeParser STRING_LIST
    • COMMA_DELIMITED_STRING_LIST

      public static final AttributeParser COMMA_DELIMITED_STRING_LIST
    • PROPERTIES_PARSER

      public static final AttributeParser PROPERTIES_PARSER
    • PROPERTIES_PARSER_UNWRAPPED

      public static final AttributeParser PROPERTIES_PARSER_UNWRAPPED
    • OBJECT_PARSER

      public static final AttributeParser OBJECT_PARSER
    • OBJECT_LIST_PARSER

      public static final AttributeParser OBJECT_LIST_PARSER
    • WRAPPED_OBJECT_LIST_PARSER

      public static final AttributeParser WRAPPED_OBJECT_LIST_PARSER
    • UNWRAPPED_OBJECT_LIST_PARSER

      public static final AttributeParser UNWRAPPED_OBJECT_LIST_PARSER
  • Constructor Details

    • AttributeParser

      public AttributeParser()
  • Method Details

    • parseAndSetParameter

      public void parseAndSetParameter(AttributeDefinition attribute, String value, org.jboss.dmr.ModelNode operation, XMLStreamReader reader) throws XMLStreamException
      Creates a ModelNode using the given value after first validating the node against this object's validator., and then stores it in the given operation model node as a key/value pair whose key is this attribute's getName() name}.

      If value is null an undefined node will be stored if such a value is acceptable to the validator.

      The expected usage of this method is in parsers seeking to build up an operation to store their parsed data into the configuration.

      Parameters:
      value - the value. Will be trimmed before use if not null.
      operation - model node of type ModelType.OBJECT into which the parsed value should be stored
      reader - XMLStreamReader from which the location from which the attribute value was read can be obtained and used in any XMLStreamException, in case the given value is invalid.
      Throws:
      XMLStreamException - if value is not valid
    • parse

      public org.jboss.dmr.ModelNode parse(AttributeDefinition attribute, String value, XMLStreamReader reader) throws XMLStreamException
      Creates and returns a ModelNode using the given value after first validating the node against this object's validator.

      If value is null an undefined node will be returned.

      Parameters:
      value - the value. Will be trimmed before use if not null.
      reader - XMLStreamReader from which the location from which the attribute value was read can be obtained and used in any XMLStreamException, in case the given value is invalid.
      Returns:
      ModelNode representing the parsed value
      Throws:
      XMLStreamException - if value is not valid
      See Also:
    • isParseAsElement

      public boolean isParseAsElement()
    • parseElement

      public void parseElement(AttributeDefinition attribute, org.jboss.staxmapper.XMLExtendedStreamReader reader, org.jboss.dmr.ModelNode operation) throws XMLStreamException
      Throws:
      XMLStreamException
    • getXmlName

      public String getXmlName(AttributeDefinition attribute)
    • getCardinality

      public XMLCardinality getCardinality(AttributeDefinition attribute)
      Returns the cardinality of the XML particle for the specified attribute.
      Parameters:
      attribute - an attribute definition
      Returns:
      the cardinality of the XML particle for the specified attribute.