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
public abstract class AttributeParser extends Object
- Author:
- Tomaz Cerar (c) 2014 Red Hat Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttributeParser.DiscardOldDefaultValueParser
-
Field Summary
Fields Modifier and Type Field Description static AttributeParserCOMMA_DELIMITED_STRING_LISTstatic AttributeParserLISTDeprecated.static AttributeParserOBJECT_LIST_PARSERstatic AttributeParserOBJECT_PARSERstatic AttributeParserPROPERTIES_PARSERstatic AttributeParserPROPERTIES_PARSER_UNWRAPPEDstatic AttributeParserSIMPLEstatic AttributeParserSTRING_LISTstatic AttributeParserUNWRAPPED_OBJECT_LIST_PARSERstatic AttributeParserWRAPPED_OBJECT_LIST_PARSER
-
Constructor Summary
Constructors Constructor Description AttributeParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetXmlName(AttributeDefinition attribute)booleanisParseAsElement()org.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 Detail
-
SIMPLE
public static final AttributeParser SIMPLE
-
LIST
@Deprecated public static final AttributeParser LIST
Deprecated.
-
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
-
-
Method Detail
-
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:
parseAndSetParameter(org.jboss.as.controller.AttributeDefinition, String, ModelNode, XMLStreamReader)
-
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)
-
-