public class SimpleAttributeDefinition extends AttributeDefinition
Resource
, with utility
methods for conversion to and from xml and for validation.attributeMarshaller, COMPLEX_TYPES
Constructor and Description |
---|
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
MeasurementUnit measurementUnit) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
MeasurementUnit measurementUnit,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
String[] alternatives)
Deprecated.
|
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelType type,
boolean allowNull) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelType type,
boolean allowNull,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelType type,
boolean allowNull,
MeasurementUnit measurementUnit) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelType type,
boolean allowNull,
MeasurementUnit measurementUnit,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelType type,
boolean allowNull,
ParameterCorrector corrector,
ParameterValidator validator)
Deprecated.
|
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit) |
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit,
ParameterCorrector corrector,
ParameterValidator validator,
boolean validateNull,
String[] alternatives,
String[] requires,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit,
ParameterCorrector corrector,
ParameterValidator validator,
boolean validateNull,
String[] alternatives,
String[] requires,
AttributeMarshaller attributeMarshaller,
boolean resourceOnly,
DeprecationData deprecated,
AccessConstraintDefinition[] accessConstraints,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit,
ParameterCorrector corrector,
ParameterValidator validator,
boolean validateNull,
String[] alternatives,
String[] requires,
AttributeMarshaller attributeMarshaller,
boolean resourceOnly,
DeprecationData deprecated,
AccessConstraintDefinition[] accessConstraints,
Boolean nullSignificant,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit,
ParameterCorrector corrector,
ParameterValidator validator,
boolean validateNull,
String[] alternatives,
String[] requires,
AttributeMarshaller attributeMarshaller,
boolean resourceOnly,
DeprecationData deprecated,
AttributeAccess.Flag... flags) |
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit,
ParameterValidator validator) |
SimpleAttributeDefinition(String name,
String xmlName,
org.jboss.dmr.ModelNode defaultValue,
org.jboss.dmr.ModelType type,
boolean allowNull,
boolean allowExpression,
MeasurementUnit measurementUnit,
ParameterValidator validator,
String[] alternatives,
String[] requires,
AttributeAccess.Flag... flags) |
Modifier and Type | Method and Description |
---|---|
void |
marshallAsAttribute(org.jboss.dmr.ModelNode resourceModel,
boolean marshallDefault,
XMLStreamWriter writer)
Marshalls the value from the given
resourceModel as an xml attribute, if it
is marshallable . |
void |
marshallAsAttribute(org.jboss.dmr.ModelNode resourceModel,
XMLStreamWriter writer)
Marshalls the value from the given
resourceModel as an xml attribute, if it
is marshallable . |
void |
marshallAsElement(org.jboss.dmr.ModelNode resourceModel,
boolean marshallDefault,
XMLStreamWriter writer)
Marshalls the value from the given
resourceModel as an xml element, if it
is marshallable . |
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 validator . |
void |
parseAndSetParameter(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 a key/value pair whose key is this attribute's name . |
addAccessConstraints, addAllowedValuesToDescription, addDeprecatedInfo, addOperationParameterDescription, addOperationParameterDescription, addResourceAttributeDescription, addResourceAttributeDescription, convertParameterExpressions, convertStringExpression, correctValue, getAccessConstraints, getAlternatives, getAttributeDeprecatedDescription, getAttributeMarshaller, getAttributeTextDescription, getDefaultValue, getDeprecationData, getFlags, getMeasurementUnit, getName, getNoTextDescription, getRequires, getType, getValidator, getXmlName, hasAlternative, isAllowed, isAllowExpression, isAllowNull, isDeprecated, isMarshallable, isMarshallable, isNullSignificant, isRequired, isResourceOnly, marshallAsElement, resolveModelAttribute, resolveModelAttribute, resolveValue, resolveValue, validateAndSet, validateOperation
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelType type, boolean allowNull)
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelType type, boolean allowNull, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelType type, boolean allowNull, MeasurementUnit measurementUnit)
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelType type, boolean allowNull, MeasurementUnit measurementUnit, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull)
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, MeasurementUnit measurementUnit)
public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, MeasurementUnit measurementUnit, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit, ParameterValidator validator)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit, ParameterValidator validator, String[] alternatives, String[] requires, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit, ParameterCorrector corrector, ParameterValidator validator, boolean validateNull, String[] alternatives, String[] requires, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit, ParameterCorrector corrector, ParameterValidator validator, boolean validateNull, String[] alternatives, String[] requires, AttributeMarshaller attributeMarshaller, boolean resourceOnly, DeprecationData deprecated, AttributeAccess.Flag... flags)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit, ParameterCorrector corrector, ParameterValidator validator, boolean validateNull, String[] alternatives, String[] requires, AttributeMarshaller attributeMarshaller, boolean resourceOnly, DeprecationData deprecated, AccessConstraintDefinition[] accessConstraints, AttributeAccess.Flag... flags)
@Deprecated public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, String[] alternatives)
@Deprecated public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelType type, boolean allowNull, ParameterCorrector corrector, ParameterValidator validator)
public SimpleAttributeDefinition(String name, String xmlName, org.jboss.dmr.ModelNode defaultValue, org.jboss.dmr.ModelType type, boolean allowNull, boolean allowExpression, MeasurementUnit measurementUnit, ParameterCorrector corrector, ParameterValidator validator, boolean validateNull, String[] alternatives, String[] requires, AttributeMarshaller attributeMarshaller, boolean resourceOnly, DeprecationData deprecated, AccessConstraintDefinition[] accessConstraints, Boolean nullSignificant, AttributeAccess.Flag... flags)
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 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 validparseAndSetParameter(String, ModelNode, XMLStreamReader)
public void parseAndSetParameter(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 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 validpublic void marshallAsAttribute(org.jboss.dmr.ModelNode resourceModel, XMLStreamWriter writer) throws XMLStreamException
resourceModel
as an xml attribute, if it
is marshallable
.
Invoking this method is the same as calling marshallAsAttribute(resourceModel, true, writer)
resourceModel
- the model, a non-null node of ModelType.OBJECT
.writer
- stream writer to use for writing the attributeXMLStreamException
- if writer
throws an exceptionpublic void marshallAsAttribute(org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException
resourceModel
as an xml attribute, if it
is marshallable
.resourceModel
- the model, a non-null node of ModelType.OBJECT
.marshallDefault
- true
if the value should be marshalled even if it matches the default valuewriter
- stream writer to use for writing the attributeXMLStreamException
- if writer
throws an exceptionpublic void marshallAsElement(org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException
resourceModel
as an xml element, if it
is marshallable
.
This implementation marshalls the attribute value as text content of the element.marshallAsElement
in class AttributeDefinition
resourceModel
- the model, a non-null node of ModelType.OBJECT
.writer
- stream writer to use for writing the attributeXMLStreamException
- if thrown by writer
Copyright © 2013 JBoss by Red Hat. All rights reserved.