Class AttributeParser

    • Constructor Detail

      • AttributeParser

        public AttributeParser()
    • Method Detail

      • 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
      • isParseAsElement

        public boolean isParseAsElement()
      • 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.