com.atlassian.bamboo.rest.adapter
Class NamedEntityAdapter<T>
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<Element,NamedEntity<T>>
com.atlassian.bamboo.rest.adapter.NamedEntityAdapter<T>
- Direct Known Subclasses:
- BitbucketNodeEntityAdapter, FieldErrorsEntityAdapter
public abstract class NamedEntityAdapter<T>
- extends XmlAdapter<Element,NamedEntity<T>>
Used for creating XML in form of:
which is particularly useful when you're supposed to marshall/unmarshall lists formatted like:
For more explanation see UT for NamedEntity
class.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamedEntityAdapter
public NamedEntityAdapter()
getEntityType
public abstract Class<T> getEntityType()
createNamedEntity
public abstract NamedEntity<T> createNamedEntity(@NotNull
String name,
@NotNull
T value)
marshal
public Element marshal(@Nullable
NamedEntity<T> entity)
throws Exception
- Specified by:
marshal
in class XmlAdapter<Element,NamedEntity<T>>
- Throws:
Exception
unmarshal
public NamedEntity<T> unmarshal(@Nullable
Element element)
throws Exception
- Specified by:
unmarshal
in class XmlAdapter<Element,NamedEntity<T>>
- Throws:
Exception
Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.