public class SimpleAttributeDefinition extends AttributeDefinition
Resource or a
parameter or reply value type field in an OperationDefinition, with utility
methods for conversion to and from xml and for validation.AttributeDefinition.NameAndGroupattributeMarshaller, COMPLEX_TYPES, referenceRecorder| Modifier | Constructor and Description |
|---|---|
protected |
SimpleAttributeDefinition(AbstractAttributeDefinitionBuilder<?,? extends SimpleAttributeDefinition> builder) |
|
SimpleAttributeDefinition(String name,
org.jboss.dmr.ModelType type,
boolean allowNull)
Deprecated.
|
| 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)
Deprecated.
|
org.jboss.dmr.ModelNode |
parse(String value,
XMLStreamReader reader)
Deprecated.
|
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, addCapabilityRequirements, addCapabilityRequirements, addDeprecatedInfo, addOperationParameterDescription, addOperationParameterDescription, addOperationReplyDescription, addOperationReplyDescription, addResourceAttributeDescription, addResourceAttributeDescription, convertParameterExpressions, convertStringExpression, correctValue, getAccessConstraints, getAllowedValues, getAlternatives, getArbitraryDescriptors, getAttributeDeprecatedDescription, getAttributeGroup, getAttributeMarshaller, getAttributeTextDescription, getCorrector, getDefaultValue, getDeprecationData, getFlags, getImmutableFlags, getMarshaller, getMeasurementUnit, getName, getNoTextDescription, getParser, getReferenceRecorder, getRequires, getType, getUndefinedMetricValue, getValidator, getXmlName, hasAlternative, hasCapabilityRequirements, isAllowed, isAllowExpression, isAllowNull, isDeprecated, isMarshallable, isMarshallable, isNillable, isNullSignificant, isRequired, isRequired, isResourceOnly, isValidatingNull, marshallAsElement, removeCapabilityRequirements, removeCapabilityRequirements, resolveModelAttribute, resolveModelAttribute, resolveValue, resolveValue, validateAndSet, validateOperation@Deprecated public SimpleAttributeDefinition(String name, org.jboss.dmr.ModelType type, boolean allowNull)
SimpleAttributeDefinitionBuildername - the name of the attribute. Cannot be nulltype - the type of the attribute value. Cannot be nullallowNull - true if ModelType.UNDEFINED is a valid type for the valueprotected SimpleAttributeDefinition(AbstractAttributeDefinitionBuilder<?,? extends SimpleAttributeDefinition> builder)
@Deprecated public org.jboss.dmr.ModelNode parse(String value, XMLStreamReader reader) throws XMLStreamException
AttributeDefinition.getParser()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 exception@Deprecated public 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 AttributeDefinitionmarshallDefault - resourceModel - the model, a non-null node of ModelType.OBJECT.writer - stream writer to use for writing the attributeXMLStreamExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.