public abstract class AttributeMarshaller extends Object
Constructor and Description |
---|
AttributeMarshaller() |
Modifier and Type | Method and Description |
---|---|
boolean |
isMarshallable(AttributeDefinition attribute,
org.jboss.dmr.ModelNode resourceModel)
Gets whether the given
resourceModel has a value for this attribute that should be marshalled to XML. |
boolean |
isMarshallable(AttributeDefinition attribute,
org.jboss.dmr.ModelNode resourceModel,
boolean marshallDefault)
Gets whether the given
resourceModel has a value for this attribute that should be marshalled to XML. |
boolean |
isMarshallableAsElement() |
void |
marshallAsAttribute(AttributeDefinition attribute,
org.jboss.dmr.ModelNode resourceModel,
boolean marshallDefault,
XMLStreamWriter writer)
Marshalls the value from the given
resourceModel as an xml element, if it
is marshallable . |
void |
marshallAsElement(AttributeDefinition attribute,
org.jboss.dmr.ModelNode resourceModel,
boolean marshallDefault,
XMLStreamWriter writer) |
public boolean isMarshallable(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel)
resourceModel
has a value for this attribute that should be marshalled to XML.
This is the same as isMarshallable(resourceModel, true)
.
attribute
- - attribute for which marshaling is being doneresourceModel
- the model, a non-null node of ModelType.OBJECT
.true
if the given resourceModel
has a defined value under this attribute's AttributeDefinition.getName()
() name}.public boolean isMarshallable(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault)
resourceModel
has a value for this attribute that should be marshalled to XML.attribute
- - attribute for which marshaling is being doneresourceModel
- the model, a non-null node of ModelType.OBJECT
.marshallDefault
- true
if the value should be marshalled even if it matches the default valuetrue
if the given resourceModel
has a defined value under this attribute's AttributeDefinition.getName()
() name}
and marshallDefault
is true
or that value differs from this attribute's default value
.public void marshallAsAttribute(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException
resourceModel
as an xml element, if it
is marshallable
.attribute
- - attribute for which marshaling is being doneresourceModel
- the model, a non-null node of ModelType.OBJECT
.writer
- stream writer to use for writing the attributeXMLStreamException
- if thrown by writer
public void marshallAsElement(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public boolean isMarshallableAsElement()
Copyright © 2014 JBoss by Red Hat. All rights reserved.