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 class
AttributeParser.DiscardOldDefaultValueParser
-
Field Summary
Fields Modifier and Type Field Description static AttributeParser
COMMA_DELIMITED_STRING_LIST
static AttributeParser
LIST
Deprecated.static AttributeParser
OBJECT_LIST_PARSER
static AttributeParser
OBJECT_PARSER
static AttributeParser
PROPERTIES_PARSER
static AttributeParser
PROPERTIES_PARSER_UNWRAPPED
static AttributeParser
SIMPLE
static AttributeParser
STRING_LIST
static AttributeParser
UNWRAPPED_OBJECT_LIST_PARSER
static AttributeParser
WRAPPED_OBJECT_LIST_PARSER
-
Constructor Summary
Constructors Constructor Description AttributeParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getXmlName(AttributeDefinition attribute)
boolean
isParseAsElement()
org.jboss.dmr.ModelNode
parse(AttributeDefinition attribute, String value, XMLStreamReader reader)
Creates and returns aModelNode
using the givenvalue
after first validating the node againstthis object's validator
.void
parseAndSetParameter(AttributeDefinition attribute, String value, org.jboss.dmr.ModelNode operation, XMLStreamReader reader)
Creates aModelNode
using the givenvalue
after first validating the node againstthis object's validator
., and then stores it in the givenoperation
model node as a key/value pair whose key is this attribute's getName() name}.void
parseElement(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 aModelNode
using the givenvalue
after first validating the node againstthis object's validator
., and then stores it in the givenoperation
model node as a key/value pair whose key is this attribute's getName() name}.If
value
isnull
anundefined
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 betrimmed
before use if notnull
.operation
- model node of typeModelType.OBJECT
into which the parsed value should be storedreader
-XMLStreamReader
from which thelocation
from which the attribute value was read can be obtained and used in anyXMLStreamException
, in case the given value is invalid.- Throws:
XMLStreamException
- ifvalue
is not valid
-
parse
public org.jboss.dmr.ModelNode parse(AttributeDefinition attribute, String value, XMLStreamReader reader) throws XMLStreamException
Creates and returns aModelNode
using the givenvalue
after first validating the node againstthis object's validator
.If
value
isnull
anundefined
node will be returned.- Parameters:
value
- the value. Will betrimmed
before use if notnull
.reader
-XMLStreamReader
from which thelocation
from which the attribute value was read can be obtained and used in anyXMLStreamException
, in case the given value is invalid.- Returns:
ModelNode
representing the parsed value- Throws:
XMLStreamException
- ifvalue
is 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)
-
-