public abstract class ListAttributeDefinition extends AttributeDefinition
ModelType.LIST
attribute in a Resource
, with utility
methods for conversion to and from xml and for validation.Constructor and Description |
---|
ListAttributeDefinition(String name,
boolean allowNull,
ParameterValidator elementValidator) |
ListAttributeDefinition(String name,
boolean allowNull,
ParameterValidator elementValidator,
AttributeAccess.Flag... flags) |
ListAttributeDefinition(String name,
String xmlName,
boolean allowNull,
int minSize,
int maxSize,
ParameterValidator elementValidator) |
ListAttributeDefinition(String name,
String xmlName,
boolean allowNull,
int minSize,
int maxSize,
ParameterValidator elementValidator,
String[] alternatives,
String[] requires,
AttributeAccess.Flag... flags) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addAttributeValueTypeDescription(org.jboss.dmr.ModelNode node,
ResourceDescriptionResolver resolver,
Locale locale,
ResourceBundle bundle) |
org.jboss.dmr.ModelNode |
addOperationParameterDescription(org.jboss.dmr.ModelNode resourceDescription,
String operationName,
ResourceDescriptionResolver resolver,
Locale locale,
ResourceBundle bundle)
Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the
given overall operation description model node.
|
org.jboss.dmr.ModelNode |
addOperationParameterDescription(ResourceBundle bundle,
String prefix,
org.jboss.dmr.ModelNode operationDescription)
Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the
given overall operation description model node.
|
protected abstract void |
addOperationParameterValueTypeDescription(org.jboss.dmr.ModelNode node,
String operationName,
ResourceDescriptionResolver resolver,
Locale locale,
ResourceBundle bundle) |
org.jboss.dmr.ModelNode |
addResourceAttributeDescription(org.jboss.dmr.ModelNode resourceDescription,
ResourceDescriptionResolver resolver,
Locale locale,
ResourceBundle bundle)
Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource
description model node.
|
org.jboss.dmr.ModelNode |
addResourceAttributeDescription(ResourceBundle bundle,
String prefix,
org.jboss.dmr.ModelNode resourceDescription)
Creates a returns a basic model node describing the attribute, after attaching it to the given overall resource
description model node.
|
protected abstract void |
addValueTypeDescription(org.jboss.dmr.ModelNode node,
ResourceBundle bundle) |
ParameterValidator |
getElementValidator()
The validator used to validate elements in the list.
|
org.jboss.dmr.ModelNode |
parse(String value,
Location location)
Deprecated.
|
org.jboss.dmr.ModelNode |
parse(String value,
XMLStreamReader reader)
Creates and returns a
ModelNode using the given value after first validating the node
against this object's element validator . |
void |
parseAndAddParameterElement(String value,
org.jboss.dmr.ModelNode operation,
Location location)
Deprecated.
|
void |
parseAndAddParameterElement(String value,
org.jboss.dmr.ModelNode operation,
XMLStreamReader reader)
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 an element in a ModelType.LIST value in a key/value pair whose key is this attribute's
name . |
correctValue, getAlternatives, getAttributeTextDescription, getDefaultValue, getFlags, getMeasurementUnit, getName, getNoTextDescription, getRequires, getType, getValidator, getXmlName, hasAlternative, isAllowed, isAllowExpression, isAllowNull, isMarshallable, isMarshallable, isRequired, marshallAsElement, resolveModelAttribute, validateAndSet, validateOperation, validateResolvedOperation
public ListAttributeDefinition(String name, boolean allowNull, ParameterValidator elementValidator)
public ListAttributeDefinition(String name, boolean allowNull, ParameterValidator elementValidator, AttributeAccess.Flag... flags)
public ListAttributeDefinition(String name, String xmlName, boolean allowNull, int minSize, int maxSize, ParameterValidator elementValidator)
public ListAttributeDefinition(String name, String xmlName, boolean allowNull, int minSize, int maxSize, ParameterValidator elementValidator, String[] alternatives, String[] requires, AttributeAccess.Flag... flags)
public ParameterValidator getElementValidator()
public org.jboss.dmr.ModelNode parse(String value, XMLStreamReader reader) throws XMLStreamException
ModelNode
using the given value
after first validating the node
against this object's element validator
.
If value
is null
an undefined
node will be returned.
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.ModelNode
representing the parsed valueXMLStreamException
- if value
is not validparseAndAddParameterElement(String, ModelNode, XMLStreamReader)
@Deprecated public org.jboss.dmr.ModelNode parse(String value, Location location) throws XMLStreamException
parse(String, XMLStreamReader)
ModelNode
using the given value
after first validating the node
against this object's element validator
.
If value
is null
an undefined
node will be returned.
value
- the value. Will be trimmed
before use if not null
.location
- current location of the parser's XMLStreamReader
. Used for any exception
messageModelNode
representing the parsed valueXMLStreamException
- if value
is not validparseAndAddParameterElement(String, ModelNode, Location)
public void parseAndAddParameterElement(String value, org.jboss.dmr.ModelNode operation, XMLStreamReader reader) throws XMLStreamException
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 an element in a ModelType.LIST
value in a key/value pair whose key is this attribute's
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.
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 storedreader
- 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.XMLStreamException
- if value
is not valid@Deprecated public void parseAndAddParameterElement(String value, org.jboss.dmr.ModelNode operation, Location location) throws XMLStreamException
parseAndAddParameterElement(String, ModelNode, XMLStreamReader)
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 an element in a ModelType.LIST
value in a key/value pair whose key is this attribute's
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.
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 storedlocation
- current location of the parser's XMLStreamReader
. Used for any exception
messageXMLStreamException
- if value
is not validpublic org.jboss.dmr.ModelNode addResourceAttributeDescription(ResourceBundle bundle, String prefix, org.jboss.dmr.ModelNode resourceDescription)
AttributeDefinition
addResourceAttributeDescription
in class AttributeDefinition
bundle
- resource bundle to use for text descriptionsprefix
- prefix to prepend to the attribute name key when looking up descriptionsresourceDescription
- the overall resource descriptionpublic org.jboss.dmr.ModelNode addResourceAttributeDescription(org.jboss.dmr.ModelNode resourceDescription, ResourceDescriptionResolver resolver, Locale locale, ResourceBundle bundle)
AttributeDefinition
addResourceAttributeDescription
in class AttributeDefinition
resourceDescription
- the overall resource descriptionresolver
- provider of localized text descriptionslocale
- locale to pass to the resolverbundle
- bundle to pass to the resolverpublic org.jboss.dmr.ModelNode addOperationParameterDescription(org.jboss.dmr.ModelNode resourceDescription, String operationName, ResourceDescriptionResolver resolver, Locale locale, ResourceBundle bundle)
AttributeDefinition
addOperationParameterDescription
in class AttributeDefinition
resourceDescription
- the overall resource descriptionoperationName
- the operation nameresolver
- provider of localized text descriptionslocale
- locale to pass to the resolverbundle
- bundle to pass to the resolverpublic org.jboss.dmr.ModelNode addOperationParameterDescription(ResourceBundle bundle, String prefix, org.jboss.dmr.ModelNode operationDescription)
AttributeDefinition
addOperationParameterDescription
in class AttributeDefinition
bundle
- resource bundle to use for text descriptionsprefix
- prefix to prepend to the attribute name key when looking up descriptionsoperationDescription
- the overall resource descriptionprotected abstract void addValueTypeDescription(org.jboss.dmr.ModelNode node, ResourceBundle bundle)
protected abstract void addAttributeValueTypeDescription(org.jboss.dmr.ModelNode node, ResourceDescriptionResolver resolver, Locale locale, ResourceBundle bundle)
protected abstract void addOperationParameterValueTypeDescription(org.jboss.dmr.ModelNode node, String operationName, ResourceDescriptionResolver resolver, Locale locale, ResourceBundle bundle)
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.