Package org.jboss.as.controller
Class AttributeParser
java.lang.Object
org.jboss.as.controller.AttributeParser
- Direct Known Subclasses:
AttributeParser.DiscardOldDefaultValueParser,AttributeParsers.AttributeElementParser,AttributeParsers.MapParser,AttributeParsers.ObjectParser,AttributeParsers.WrappedObjectListParser
- Author:
- Tomaz Cerar (c) 2014 Red Hat Inc.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AttributeParserstatic final AttributeParserstatic final AttributeParserstatic final AttributeParserstatic final AttributeParserstatic final AttributeParserstatic final AttributeParserstatic final AttributeParserstatic final AttributeParser -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCardinality(AttributeDefinition attribute) Returns the cardinality of the XML particle for the specified attribute.getXmlName(AttributeDefinition attribute) booleanorg.jboss.dmr.ModelNodeparse(AttributeDefinition attribute, String value, XMLStreamReader reader) Creates and returns aModelNodeusing the givenvalueafter first validating the node againstthis object's validator.voidparseAndSetParameter(AttributeDefinition attribute, String value, org.jboss.dmr.ModelNode operation, XMLStreamReader reader) Creates aModelNodeusing the givenvalueafter first validating the node againstthis object's validator., and then stores it in the givenoperationmodel node as a key/value pair whose key is this attribute's getName() name}.voidparseElement(AttributeDefinition attribute, org.jboss.staxmapper.XMLExtendedStreamReader reader, org.jboss.dmr.ModelNode operation)
-
Field Details
-
SIMPLE
-
STRING_LIST
-
COMMA_DELIMITED_STRING_LIST
-
PROPERTIES_PARSER
-
PROPERTIES_PARSER_UNWRAPPED
-
OBJECT_PARSER
-
OBJECT_LIST_PARSER
-
WRAPPED_OBJECT_LIST_PARSER
-
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 aModelNodeusing the givenvalueafter first validating the node againstthis object's validator., and then stores it in the givenoperationmodel node as a key/value pair whose key is this attribute's getName() name}.If
valueisnullanundefinednode 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 betrimmedbefore use if notnull.operation- model node of typeModelType.OBJECTinto which the parsed value should be storedreader-XMLStreamReaderfrom which thelocationfrom which the attribute value was read can be obtained and used in anyXMLStreamException, in case the given value is invalid.- Throws:
XMLStreamException- ifvalueis not valid
-
parse
public org.jboss.dmr.ModelNode parse(AttributeDefinition attribute, String value, XMLStreamReader reader) throws XMLStreamException Creates and returns aModelNodeusing the givenvalueafter first validating the node againstthis object's validator.If
valueisnullanundefinednode will be returned.- Parameters:
value- the value. Will betrimmedbefore use if notnull.reader-XMLStreamReaderfrom which thelocationfrom which the attribute value was read can be obtained and used in anyXMLStreamException, in case the given value is invalid.- Returns:
ModelNoderepresenting the parsed value- Throws:
XMLStreamException- ifvalueis 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
-
getCardinality
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.
-