Class AttributeDefinition
- All Implemented Interfaces:
Feature
- Direct Known Subclasses:
ListAttributeDefinition,MapAttributeDefinition,SimpleAttributeDefinition
Resource or a
parameter or reply value type field in an OperationDefinition, with utility
methods for validation.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSimpleComparablethat encapsulates the name of an attribute and any attribute group, ordering first one group (null group first) and then one attribute name. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Set<org.jboss.dmr.ModelType>TheModelTypetypes that reflect complex DMR structures --LIST,OBJECT,PROPERTY} -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAttributeDefinition(AbstractAttributeDefinitionBuilder<?, ?> builder) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAccessConstraints(org.jboss.dmr.ModelNode result, Locale locale) protected voidaddAllowedValuesToDescription(org.jboss.dmr.ModelNode result, ParameterValidator validator) Adds the allowed values.voidaddCapabilityRequirements(OperationContext context, Resource resource, org.jboss.dmr.ModelNode attributeValue) Based on the given attribute value, add capability requirements.org.jboss.dmr.ModelNodeaddDeprecatedInfo(org.jboss.dmr.ModelNode model) Adds attribute deprecation information, if relevant, to the given attribute description nodeorg.jboss.dmr.ModelNodeaddOperationParameterDescription(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.org.jboss.dmr.ModelNodeaddOperationParameterDescription(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.ModelNodeaddOperationReplyDescription(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.org.jboss.dmr.ModelNodeaddOperationReplyDescription(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.ModelNodeaddResourceAttributeDescription(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.org.jboss.dmr.ModelNodeaddResourceAttributeDescription(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.protected org.jboss.dmr.ModelNodeconvertParameterExpressions(org.jboss.dmr.ModelNode parameter) Examine the given operation parameter value for any expression syntax, converting the relevant node toModelType.EXPRESSIONif such is supported.protected static org.jboss.dmr.ModelNodeconvertStringExpression(org.jboss.dmr.ModelNode node) Checks if the given node is ofModelType.STRINGwith a string value that includes expression syntax.protected final org.jboss.dmr.ModelNodecorrectValue(org.jboss.dmr.ModelNode newValue, org.jboss.dmr.ModelNode oldValue) Corrects the value if thevalue correctoris notnull.booleanList<org.jboss.dmr.ModelNode>returns array with all allowed valuesString[]Gets the names of other attributes whose value must beundefinedif this attribute's value is defined, and vice versa.getAttributeDeprecatedDescription(ResourceBundle bundle, String prefix) Gets localized deprecation text from the givenResourceBundlefor the attribute.Gets the name of the attribute group with which this attribute is associated, if any.getAttributeTextDescription(ResourceBundle bundle, String prefix) Gets localized text from the givenResourceBundlefor the attribute.Gets the corrector used to correct values before checking that they comply with the attribute's definition.org.jboss.dmr.ModelNodeGets the default value to use for the attribute if a value was not provided.return deprecation data if there is anygetFlags()Returns an immutable set of anyflagsused to indicate special characteristics of the attributeThe unit of measure in which an attribute with a numerical value is expressed.getName()The attribute's name in the management model.org.jboss.dmr.ModelNodegetNoTextDescription(boolean forOperation) Gets descriptive metadata for this attribute, excluding free-from textdescriptionfields.protected CapabilityReferenceRecorderString[]Gets the names of other attributes whose value must not beundefinedif this attribute's value is defined.Returns the stability level of this feature.org.jboss.dmr.ModelTypegetType()The expectedtypeof theModelNodethat holds the attribute data.org.jboss.dmr.ModelNodeGets the undefined metric value to use for the attribute if a value cannot be provided.Gets the validator used to validate that values comply with the attribute's definition.The attribute's name in the xml configuration.booleanhasAlternative(org.jboss.dmr.ModelNode operationObject) Gets whether this attribute hasalternativesconfigured and the givenoperationObjecthas any of those alternatives defined.booleanBased on the given attribute value, tell if attribute has any capability requirements.inthashCode()booleanisAllowed(org.jboss.dmr.ModelNode operationObject) Inverse ofhasAlternative(org.jboss.dmr.ModelNode).booleanWhether aModelNodeholding the value of this attribute can beModelType.EXPRESSION.booleanbooleanisMarshallable(org.jboss.dmr.ModelNode resourceModel) Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.booleanisMarshallable(org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault) Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.booleanWhether aModelNodeholding the value of this attribute can beModelType.UNDEFINEDin any situation.final booleanGets whether an access control check is required to implicitly set an attribute toundefinedin a resource "add" operation.booleanWhether aModelNodeholding the value of this attribute can beModelType.UNDEFINEDwhen all other attributes in the same overall model that arealternativesof this attribute are undefined.booleanisRequired(org.jboss.dmr.ModelNode operationObject) Gets whether this attribute must be defined in the givenoperationObjectbooleanShow if attribute is resource only which means it wont be part of add operations but only present on resourcevoidmarshallAsElement(org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) Marshalls the value from the givenresourceModelas an xml element, if itis marshallable.voidmarshallAsElement(org.jboss.dmr.ModelNode resourceModel, XMLStreamWriter writer) Marshalls the value from the givenresourceModelas an xml element, if itis marshallable.voidremoveCapabilityRequirements(OperationContext context, Resource resource, org.jboss.dmr.ModelNode attributeValue) Based on the given attribute value, remove capability requirements.org.jboss.dmr.ModelNoderesolveModelAttribute(ExpressionResolver resolver, org.jboss.dmr.ModelNode model) Finds a value in the givenmodelwhose key matches this attribute'sname, uses the givenresolvertoExpressionResolver.resolveExpressions(org.jboss.dmr.ModelNode)resolve} it and validates it using this attribute'svalidator.org.jboss.dmr.ModelNoderesolveModelAttribute(OperationContext context, org.jboss.dmr.ModelNode model) org.jboss.dmr.ModelNoderesolveValue(ExpressionResolver resolver, org.jboss.dmr.ModelNode value) Takes the givenvalue, resolves it using the givenresolverand validates it using this attribute'svalidator.org.jboss.dmr.ModelNoderesolveValue(OperationContext context, org.jboss.dmr.ModelNode value) Takes the givenvalue, resolves it using the givencontextand validates it using this attribute'svalidator.toString()final voidvalidateAndSet(org.jboss.dmr.ModelNode operationObject, org.jboss.dmr.ModelNode model) org.jboss.dmr.ModelNodevalidateOperation(org.jboss.dmr.ModelNode operationObject)
-
Field Details
-
COMPLEX_TYPES
TheModelTypetypes that reflect complex DMR structures --LIST,OBJECT,PROPERTY}
-
-
Constructor Details
-
AttributeDefinition
-
-
Method Details
-
getStability
Description copied from interface:FeatureReturns the stability level of this feature.- Specified by:
getStabilityin interfaceFeature- Returns:
- a stability level
-
getName
The attribute's name in the management model.- Returns:
- the name. Will not be
null
-
getXmlName
The attribute's name in the xml configuration. Not relevant for operation parameters and reply value types.- Returns:
- the name. Will not be
null, although it may not be relevant
-
getType
public org.jboss.dmr.ModelType getType()The expectedtypeof theModelNodethat holds the attribute data.- Returns:
- the type. Will not be
null
-
isRequired
public boolean isRequired()Whether aModelNodeholding the value of this attribute can beModelType.UNDEFINEDwhen all other attributes in the same overall model that arealternativesof this attribute are undefined.In a valid model an attribute that is required must be undefined if any alternative is defined, so this method should not be used for checking if it is valid for the attribute ever to have an undefined value. Use
isNillable()for that.- Returns:
trueif anundefined ModelNodeis invalid in the absence of alternatives;falseif not
-
isNillable
public boolean isNillable()Whether aModelNodeholding the value of this attribute can beModelType.UNDEFINEDin any situation. An attribute that ordinarily isrequiredmay still be undefined in a given model if analternative attributeis defined.This is equivalent to
!isRequired() || (getAlternatives() != null && getAlternatives().length > 0).- Returns:
trueif anundefined ModelNodeis valid;falseif not
-
isNullSignificant
public final boolean isNullSignificant()Gets whether an access control check is required to implicitly set an attribute toundefinedin a resource "add" operation. "Implicitly" setting an attribute refers to not providing a value for it in the add operation, leaving the attribute in an undefined state. So, if a user attempts to add a resource but does not define some attributes, a write permission check will be performed for any attributes where this method returnstrue.Generally this is
trueifundefined is allowedand adefault valueexists, although some instances may have a different setting.- Returns:
trueif anundefinedvalue is significant
-
isAllowExpression
public boolean isAllowExpression()Whether aModelNodeholding the value of this attribute can beModelType.EXPRESSION.- Returns:
trueif anexpression ModelNodeis valid;falseif not
-
getDefaultValue
public org.jboss.dmr.ModelNode getDefaultValue()Gets the default value to use for the attribute if a value was not provided.- Returns:
- the default value, or
nullif no defined value was provided
-
getAttributeGroup
Gets the name of the attribute group with which this attribute is associated, if any.- Returns:
- the name of the group, or
nullif the attribute is not associated with a group
-
getMeasurementUnit
The unit of measure in which an attribute with a numerical value is expressed.- Returns:
- the measurement unit, or
nullif none is relevant
-
getCorrector
Gets the corrector used to correct values before checking that they comply with the attribute's definition.- Returns:
- the corrector. May be
null
-
getValidator
Gets the validator used to validate that values comply with the attribute's definition.- Returns:
- the validator. Will not be
null
-
getAlternatives
Gets the names of other attributes whose value must beundefinedif this attribute's value is defined, and vice versa.- Returns:
- the alternative attribute names, or
nullif there are no such attributes
-
getRequires
Gets the names of other attributes whose value must not beundefinedif this attribute's value is defined.- Returns:
- the required attribute names, or
nullif there are no such attributes
-
getFlags
Returns an immutable set of anyflagsused to indicate special characteristics of the attribute- Returns:
- the flags. Will not be
nullbut may be empty.
-
getAllowedValues
returns array with all allowed values- Returns:
- allowed values
-
getArbitraryDescriptors
-
isMarshallable
public boolean isMarshallable(org.jboss.dmr.ModelNode resourceModel) Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.This is the same as
isMarshallable(resourceModel, true).- Parameters:
resourceModel- the model, a non-null node ofModelType.OBJECT.- Returns:
trueif the givenresourceModelhas a defined value under this attribute'sgetName()() name}.
-
isMarshallable
public boolean isMarshallable(org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault) Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.- Parameters:
resourceModel- the model, a non-null node ofModelType.OBJECT.marshallDefault-trueif the value should be marshalled even if it matches the default value- Returns:
trueif the givenresourceModelhas a defined value under this attribute'sgetName()() name} andmarshallDefaultistrueor that value differs from this attribute'sdefault value.
-
validateOperation
public org.jboss.dmr.ModelNode validateOperation(org.jboss.dmr.ModelNode operationObject) throws OperationFailedException Finds a value in the givenoperationObjectwhose key matches this attribute'snameand validates it using this attribute'svalidator.- Parameters:
operationObject- model node of typeModelType.OBJECT, typically representing an operation request- Returns:
- the value
- Throws:
OperationFailedException- if the value is not valid
-
validateAndSet
public final void validateAndSet(org.jboss.dmr.ModelNode operationObject, org.jboss.dmr.ModelNode model) throws OperationFailedException Finds a value in the givenoperationObjectwhose key matches this attribute'sname, validates it using this attribute'svalidator, and, stores it under this attribute's name in the givenmodel.- Parameters:
operationObject- model node of typeModelType.OBJECT, typically representing an operation requestmodel- model node in which the value should be stored- Throws:
OperationFailedException- if the value is not valid
-
resolveModelAttribute
public org.jboss.dmr.ModelNode resolveModelAttribute(OperationContext context, org.jboss.dmr.ModelNode model) throws OperationFailedException Finds a value in the givenmodelwhose key matches this attribute'sname, uses the givencontexttoresolveit and validates it using this attribute'svalidator. If the value is undefined and adefault valueis available, the default value is used.- Parameters:
context- the operation contextmodel- model node of typeModelType.OBJECT, typically representing a model resource- Returns:
- the resolved value, possibly the default value if the model does not have a defined value matching this attribute's name
- Throws:
OperationFailedException- if the value is not valid
-
resolveModelAttribute
public org.jboss.dmr.ModelNode resolveModelAttribute(ExpressionResolver resolver, org.jboss.dmr.ModelNode model) throws OperationFailedException Finds a value in the givenmodelwhose key matches this attribute'sname, uses the givenresolvertoExpressionResolver.resolveExpressions(org.jboss.dmr.ModelNode)resolve} it and validates it using this attribute'svalidator. If the value is undefined and adefault valueis available, the default value is used.- Parameters:
resolver- the expression resolvermodel- model node of typeModelType.OBJECT, typically representing a model resource- Returns:
- the resolved value, possibly the default value if the model does not have a defined value matching this attribute's name
- Throws:
OperationFailedException- if the value is not valid
-
resolveValue
public org.jboss.dmr.ModelNode resolveValue(OperationContext context, org.jboss.dmr.ModelNode value) throws OperationFailedException Takes the givenvalue, resolves it using the givencontextand validates it using this attribute'svalidator. If the value is undefined and adefault valueis available, the default value is used.- Parameters:
context- the context to use toresolvethe valuevalue- a node that is expected to be a valid value for an attribute defined by this definition- Returns:
- the resolved value, possibly the default value if
valueis not defined - Throws:
OperationFailedException- if the value is not valid
-
resolveValue
public org.jboss.dmr.ModelNode resolveValue(ExpressionResolver resolver, org.jboss.dmr.ModelNode value) throws OperationFailedException Takes the givenvalue, resolves it using the givenresolverand validates it using this attribute'svalidator. If the value is undefined and adefault valueis available, the default value is used.- Parameters:
resolver- the expression resolvervalue- a node that is expected to be a valid value for an attribute defined by this definition- Returns:
- the resolved value, possibly the default value if
valueis not defined - Throws:
OperationFailedException- if the value is not valid
-
isAllowed
public boolean isAllowed(org.jboss.dmr.ModelNode operationObject) Inverse ofhasAlternative(org.jboss.dmr.ModelNode).- Parameters:
operationObject- an objectModelNodewhose keys are attribute names.- Returns:
trueifoperationObjecthas no defined values for attributes configured as our alternatives
-
isRequired
public boolean isRequired(org.jboss.dmr.ModelNode operationObject) Gets whether this attribute must be defined in the givenoperationObject- Parameters:
operationObject- an objectModelNodewhose keys are attribute names.- Returns:
trueif this attribute isrequiredand the givenoperationObjectdoes not have any defined attributes configured asalternativesto this attribute
-
hasAlternative
public boolean hasAlternative(org.jboss.dmr.ModelNode operationObject) Gets whether this attribute hasalternativesconfigured and the givenoperationObjecthas any of those alternatives defined.- Parameters:
operationObject- an objectModelNodewhose keys are attribute names.- Returns:
trueifoperationObjecthas any defined values for attributes configured as our alternatives
-
marshallAsElement
public void marshallAsElement(org.jboss.dmr.ModelNode resourceModel, XMLStreamWriter writer) throws XMLStreamException Marshalls the value from the givenresourceModelas an xml element, if itis marshallable.- Parameters:
resourceModel- the model, a non-null node ofModelType.OBJECT.writer- stream writer to use for writing the attribute- Throws:
XMLStreamException- if thrown bywriter
-
marshallAsElement
public void marshallAsElement(org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException Marshalls the value from the givenresourceModelas an xml element, if itis marshallable.- Parameters:
resourceModel- the model, a non-null node ofModelType.OBJECT.marshallDefault-trueif the value should be marshalled even if it matches the default valuewriter- stream writer to use for writing the attribute- Throws:
XMLStreamException- if thrown bywriter
-
addResourceAttributeDescription
public 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. The node describing the attribute is returned to make it easy to perform further modification.- Parameters:
bundle- resource bundle to use for text descriptionsprefix- prefix to prepend to the attribute name key when looking up descriptionsresourceDescription- the overall resource description- Returns:
- the attribute description node
-
addResourceAttributeDescription
public 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. The node describing the attribute is returned to make it easy to perform further modification.- Parameters:
resourceDescription- the overall resource descriptionresolver- provider of localized text descriptionslocale- locale to pass to the resolverbundle- bundle to pass to the resolver- Returns:
- the attribute description node
-
addOperationParameterDescription
public 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. The node describing the parameter is returned to make it easy to perform further modification.- Parameters:
bundle- resource bundle to use for text descriptionsprefix- prefix to prepend to the attribute name key when looking up descriptionsoperationDescription- the overall resource description- Returns:
- the attribute description node
-
addOperationParameterDescription
public 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. The node describing the parameter is returned to make it easy to perform further modification.- Parameters:
resourceDescription- the overall resource descriptionoperationName- the operation nameresolver- provider of localized text descriptionslocale- locale to pass to the resolverbundle- bundle to pass to the resolver- Returns:
- the attribute description node
-
addOperationReplyDescription
public org.jboss.dmr.ModelNode addOperationReplyDescription(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. The node describing the parameter is returned to make it easy to perform further modification.- Parameters:
bundle- resource bundle to use for text descriptionsprefix- prefix to prepend to the attribute name key when looking up descriptionsoperationDescription- the overall resource description- Returns:
- the attribute description node
-
addOperationReplyDescription
public org.jboss.dmr.ModelNode addOperationReplyDescription(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. The node describing the parameter is returned to make it easy to perform further modification.- Parameters:
resourceDescription- the overall resource descriptionoperationName- the operation nameresolver- provider of localized text descriptionslocale- locale to pass to the resolverbundle- bundle to pass to the resolver- Returns:
- the attribute description node
-
getAttributeTextDescription
Gets localized text from the givenResourceBundlefor the attribute.- Parameters:
bundle- the resource bundle. Cannot benullprefix- a prefix to dot-prepend to the attribute name to form a key to resolve in the bundle- Returns:
- the resolved text
-
getAttributeDeprecatedDescription
Gets localized deprecation text from the givenResourceBundlefor the attribute.- Parameters:
bundle- the resource bundle. Cannot benullprefix- a prefix to dot-prepend to the attribute name to form a key to resolve in the bundle- Returns:
- the resolved text
-
addDeprecatedInfo
public org.jboss.dmr.ModelNode addDeprecatedInfo(org.jboss.dmr.ModelNode model) Adds attribute deprecation information, if relevant, to the given attribute description node- Parameters:
model- the attribute description- Returns:
- the node added to
modelornullif no deprecation data was needed
-
getNoTextDescription
public org.jboss.dmr.ModelNode getNoTextDescription(boolean forOperation) Gets descriptive metadata for this attribute, excluding free-from textdescriptionfields.- Parameters:
forOperation-trueif the metadata is for an operation parameter or reply value type- Returns:
- object node containing the descriptive metadata
-
addCapabilityRequirements
public void addCapabilityRequirements(OperationContext context, Resource resource, org.jboss.dmr.ModelNode attributeValue) Based on the given attribute value, add capability requirements. If this definition is for an attribute whose value is or contains a reference to the name of some capability, this method should record the addition of a requirement for the capability.This is a no-op in this base class. Subclasses that support attribute types that can represent capability references should override this method.
- Parameters:
context- the operation contextresource- the resource on which requirements are gatheredattributeValue- the value of the attribute described by this object
-
removeCapabilityRequirements
public void removeCapabilityRequirements(OperationContext context, Resource resource, org.jboss.dmr.ModelNode attributeValue) Based on the given attribute value, remove capability requirements. If this definition is for an attribute whose value is or contains a reference to the name of some capability, this method should record the removal of a requirement for the capability.This is a no-op in this base class. Subclasses that support attribute types that can represent capability references should override this method.
- Parameters:
context- the operation contextresource- resource from which capability requirement is to be removed from,nullis legal value in case thatCapabilityReferenceRecorderdoesn't require it.attributeValue- the value of the attribute described by this object
-
hasCapabilityRequirements
public boolean hasCapabilityRequirements()Based on the given attribute value, tell if attribute has any capability requirements. If this definition is for an attribute whose value is or contains a reference to the name of some capability, this method will return true otherwise false.This is a no-op in this base class. Subclasses that support attribute types that can represent capability references should override this method.
- Returns:
trueif this definition is for an attribute whose value is or contains a reference to the name of some capability
-
getReferenceRecorder
-
addAllowedValuesToDescription
protected void addAllowedValuesToDescription(org.jboss.dmr.ModelNode result, ParameterValidator validator) Adds the allowed values. Override for attributes who should not use the allowed values.- Parameters:
result- the node to add the allowed values tovalidator- the validator to get the allowed values from
-
correctValue
protected final org.jboss.dmr.ModelNode correctValue(org.jboss.dmr.ModelNode newValue, org.jboss.dmr.ModelNode oldValue) Corrects the value if thevalue correctoris notnull. If thevalue correctorisnull, thenewValueparameter is returned.- Parameters:
newValue- the new value.oldValue- the old value.- Returns:
- the corrected value or the
newValueif thevalue correctorisnull.
-
convertParameterExpressions
protected org.jboss.dmr.ModelNode convertParameterExpressions(org.jboss.dmr.ModelNode parameter) Examine the given operation parameter value for any expression syntax, converting the relevant node toModelType.EXPRESSIONif such is supported.This implementation checks if
expressions are allowedand if so, callsconvertStringExpression(ModelNode)to convert aModelType.STRINGto aModelType.EXPRESSION. No other conversions are performed. For use cases requiring more complex behavior, a subclass that overrides this method should be used.If expressions are supported this implementation also checks if the
attribute typeis one of thecomplex DMR types. If it is, anIllegalStateExceptionis thrown, as this implementation cannot properly handle such a combination, and a subclass that overrides this method should be used.- Parameters:
parameter- the node to examine. Cannot not benull- Returns:
- a node matching
parameterbut with expressions converted, or the original parameter if no conversion was performed. Will not returnnull - Throws:
IllegalStateException- if expressions are supported, but theattribute typeiscomplex
-
convertStringExpression
protected static org.jboss.dmr.ModelNode convertStringExpression(org.jboss.dmr.ModelNode node) Checks if the given node is ofModelType.STRINGwith a string value that includes expression syntax. If so returns a node ofModelType.EXPRESSION, else simply returnsnodeunchanged- Parameters:
node- the node to examine. Will not benull- Returns:
- the node with expressions converted, or the original node if no conversion was performed
Cannot return
null
-
getMarshaller
- Returns:
- attribute marshaller that can be used to persist attribute to XML
-
isResourceOnly
public boolean isResourceOnly()Show if attribute is resource only which means it wont be part of add operations but only present on resource- Returns:
- true is attribute is resource only
-
isDeprecated
public boolean isDeprecated()- Returns:
- true if attribute is deprecated
-
getDeprecationData
return deprecation data if there is any- Returns:
DeprecationData
-
getAccessConstraints
-
addAccessConstraints
-
getParser
-
getUndefinedMetricValue
public org.jboss.dmr.ModelNode getUndefinedMetricValue()Gets the undefined metric value to use for the attribute if a value cannot be provided.- Returns:
- the undefined metric value, or
nullif no undefined metric value was provided
-
hashCode
public int hashCode() -
equals
-
toString
-