public abstract class AttributeMarshaller extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AttributeMarshaller.AttributeElementMarshaller
Version of marshaller that by default marshalls to element
|
Modifier and Type | Field and Description |
---|---|
static AttributeMarshaller |
ATTRIBUTE_OBJECT
Marshaller for ObjectTypeAttributeDefinition.
|
static AttributeMarshaller |
COMMA_STRING_LIST
comma delimited list marshaller
|
static AttributeMarshaller |
ELEMENT_ONLY_OBJECT
Marshaller for ObjectTypeAttributeDefinition.
|
static AttributeMarshaller |
OBJECT_LIST_MARSHALLER |
static AttributeMarshaller |
OBJECT_MAP_MARSHALLER |
static AttributeMarshaller |
PROPERTIES_MARSHALLER |
static AttributeMarshaller |
PROPERTIES_MARSHALLER_UNWRAPPED |
static AttributeMarshaller |
SIMPLE
simple marshaller
|
static AttributeMarshaller |
STRING_LIST
space delimited list marshaller
|
static AttributeMarshaller |
UNWRAPPED_OBJECT_LIST_MARSHALLER |
static AttributeMarshaller |
WRAPPED_OBJECT_LIST_MARSHALLER |
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 |
marshall(AttributeDefinition attribute,
org.jboss.dmr.ModelNode resourceModel,
boolean marshallDefault,
XMLStreamWriter writer) |
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) |
static void |
marshallElementContent(String content,
XMLStreamWriter writer)
Applies standard element text formatting such that multiline content is on a new line
from the element wrapping the text and is indented one level.
|
public static final AttributeMarshaller SIMPLE
public static final AttributeMarshaller STRING_LIST
public static final AttributeMarshaller COMMA_STRING_LIST
public static final AttributeMarshaller ELEMENT_ONLY_OBJECT
public static final AttributeMarshaller ATTRIBUTE_OBJECT
public static final AttributeMarshaller WRAPPED_OBJECT_LIST_MARSHALLER
public static final AttributeMarshaller UNWRAPPED_OBJECT_LIST_MARSHALLER
public static final AttributeMarshaller OBJECT_LIST_MARSHALLER
public static final AttributeMarshaller OBJECT_MAP_MARSHALLER
public static final AttributeMarshaller PROPERTIES_MARSHALLER
public static final AttributeMarshaller PROPERTIES_MARSHALLER_UNWRAPPED
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()
public void marshall(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void marshallElementContent(String content, XMLStreamWriter writer) throws XMLStreamException
content
- the content. Cannot be null
writer
- the writer. Cannot be null
XMLStreamException
Copyright © 2020 JBoss by Red Hat. All rights reserved.