Package org.jboss.as.controller
Class AttributeMarshaller
java.lang.Object
org.jboss.as.controller.AttributeMarshaller
- Direct Known Subclasses:
AttributeMarshaller.AttributeElementMarshaller,AttributeMarshallers.MapAttributeMarshaller,AttributeMarshallers.SimpleListAttributeMarshaller,DefaultAttributeMarshaller
- Author:
- Tomaz Cerar
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classVersion of marshaller that by default marshalls to element -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AttributeMarshallerMarshaller for ObjectTypeAttributeDefinition.static final AttributeMarshallercomma delimited list marshallerstatic final AttributeMarshallerMarshaller for ObjectTypeAttributeDefinition.static final AttributeMarshallerstatic final AttributeMarshallerstatic final AttributeMarshallerstatic final AttributeMarshallerstatic final AttributeMarshallersimple marshallerstatic final AttributeMarshallerspace delimited list marshallerstatic final AttributeMarshallerstatic final AttributeMarshaller -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisMarshallable(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel) Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.booleanisMarshallable(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault) Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.booleanvoidmarshall(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) voidmarshallAsAttribute(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) Marshalls the value from the givenresourceModelas an xml element, if itis marshallable.voidmarshallAsElement(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) static voidmarshallElementContent(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.
-
Field Details
-
SIMPLE
simple marshaller -
STRING_LIST
space delimited list marshaller -
COMMA_STRING_LIST
comma delimited list marshaller -
ELEMENT_ONLY_OBJECT
Marshaller for ObjectTypeAttributeDefinition. The object and all its attributes will be marshalled as element only. -
ATTRIBUTE_OBJECT
Marshaller for ObjectTypeAttributeDefinition. The object and all its complex types descendants will get marshalled as elements whereas simple types will get marshalled as attributes. -
WRAPPED_OBJECT_LIST_MARSHALLER
-
UNWRAPPED_OBJECT_LIST_MARSHALLER
-
OBJECT_LIST_MARSHALLER
-
OBJECT_MAP_MARSHALLER
-
PROPERTIES_MARSHALLER
-
PROPERTIES_MARSHALLER_UNWRAPPED
-
-
Constructor Details
-
AttributeMarshaller
public AttributeMarshaller()
-
-
Method Details
-
isMarshallable
Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.This is the same as
isMarshallable(resourceModel, true).- Parameters:
attribute- - attribute for which marshaling is being doneresourceModel- the model, a non-null node ofModelType.OBJECT.- Returns:
trueif the givenresourceModelhas a defined value under this attribute'sAttributeDefinition.getName()() name}.
-
isMarshallable
public boolean isMarshallable(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault) Gets whether the givenresourceModelhas a value for this attribute that should be marshalled to XML.- Parameters:
attribute- - attribute for which marshaling is being doneresourceModel- 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'sAttributeDefinition.getName()() name} andmarshallDefaultistrueor that value differs from this attribute'sdefault value.
-
marshallAsAttribute
public void marshallAsAttribute(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException Marshalls the value from the givenresourceModelas an xml element, if itis marshallable.- Parameters:
attribute- - attribute for which marshaling is being doneresourceModel- 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(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException - Throws:
XMLStreamException
-
isMarshallableAsElement
public boolean isMarshallableAsElement() -
marshall
public void marshall(AttributeDefinition attribute, org.jboss.dmr.ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException - Throws:
XMLStreamException
-
marshallElementContent
public static void marshallElementContent(String content, XMLStreamWriter writer) throws XMLStreamException 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. Single-line content is on the same line as the element.- Parameters:
content- the content. Cannot benullwriter- the writer. Cannot benull- Throws:
XMLStreamException
-