|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.gx.webmanager.services.contentrepresentation.ContentRepresentations
public final class ContentRepresentations
This is a utility class to create ContentRepresentation instances and
ContentRepresentationEntry instances via the #create(String, Collection),
createEntry(String, List) and createRefEntry(String, List) methods respectively.
This class also has methods to write ContentRepresentation instances to Strings and vice
versa. The created String is an XML representation which includes a version number for future
extensions and compatibility.
| Method Summary | |
|---|---|
static ContentRepresentation |
create(java.lang.String contentType,
WmId wmId,
java.util.Set<java.lang.String> interfaceNames,
java.util.Collection<ContentRepresentationEntry> data)
Creates a ContentRepresentation from the given values. |
static ContentRepresentationValueEntry |
createEntry(java.lang.String name,
java.util.List<java.lang.String> values)
Creates a ContentRepresentationEntry instance from the given values. |
static ContentRepresentationReferenceEntry |
createRefEntry(java.lang.String name,
java.util.List<ContentRepresentation> values)
Creates a ContentRepresentationEntry instance from the given values. |
static ContentRepresentation |
fromXml(java.lang.String representation)
Converts a String representation to a ContentRepresentation instance. |
static java.lang.String |
toXml(ContentRepresentation representation)
Flattens the given ContentRepresentation to an XML String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ContentRepresentation create(java.lang.String contentType,
WmId wmId,
java.util.Set<java.lang.String> interfaceNames,
java.util.Collection<ContentRepresentationEntry> data)
ContentRepresentation from the given values. Note that the names of the
ContentRepresentationEntry instances in the given Collection should be unique. If they
are not unique, then entries get lost in the returned representation.
contentType - the content typedata - the collection of ContentRepresentationEntrys which must have unique nameswmId - the wmId of the represented content iteminterfaceNames - the names of the interfaces that the represented content item implements
ContentRepresentation instance
public static ContentRepresentationValueEntry createEntry(java.lang.String name,
java.util.List<java.lang.String> values)
ContentRepresentationEntry instance from the given values.
name - the name of the entry, not nullvalues - the values of the entry, not null
ContentRepresentationEntry instance for the given values
public static ContentRepresentationReferenceEntry createRefEntry(java.lang.String name,
java.util.List<ContentRepresentation> values)
ContentRepresentationEntry instance from the given values.
name - the name of the entryvalues - the reference values of the entry
ContentRepresentationEntry instance for the given valuespublic static java.lang.String toXml(ContentRepresentation representation)
ContentRepresentation to an XML String. This String
representation can be converted back to a ContentRepresentation instance using the
fromXml(String) method.
Note that this method assumes a tree-structure and does not check for cycles.
representation - the ContentRepresentation to flatten
String representation in XML format
public static ContentRepresentation fromXml(java.lang.String representation)
throws ContentRepresentationException
String representation to a ContentRepresentation instance. Use in
combination with toXml(ContentRepresentation).
representation - the String representation
ContentRepresentation instance of the given String
ContentRepresentationException - on error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||