public class Workspace extends Element implements IWorkspace
Modifier and Type | Field and Description |
---|---|
static ElementKey<java.lang.Void,Workspace> |
KEY
The key for this element.
|
static AttributeKey<java.lang.String> |
TITLE
The title attribute.
|
Modifier | Constructor and Description |
---|---|
|
Workspace()
Default mutable constructor.
|
protected |
Workspace(ElementKey<?,? extends Workspace> key)
Lets subclasses create an instance using custom key.
|
protected |
Workspace(ElementKey<?,? extends Workspace> key,
Element source)
Constructs a new instance by doing a shallow copy of data from an existing
Element instance. |
|
Workspace(TextContent title)
Constructor with the title element.
|
Modifier and Type | Method and Description |
---|---|
void |
addCollection(Collection collection)
Adds a new collection.
|
Collection |
addCollection(java.lang.String collectionUri,
java.lang.String title,
java.lang.String... acceptedTypes)
Add a new collection with the given title and accept types.
|
java.util.List<Collection> |
getCollections()
Returns the collections.
|
TextContent |
getTitle()
Returns the title.
|
boolean |
hasCollections()
Returns whether it has the collections.
|
boolean |
hasTitle()
Returns whether it has the title.
|
static void |
registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
|
boolean |
removeCollection(Collection collection)
Removes an existing collection.
|
Element |
resolve(ElementMetadata<?,?> meta,
ValidationContext vc)
Resolve this element's state against the metadata.
|
void |
setTitle(TextContent title)
Sets the title.
|
java.lang.String |
toString() |
adapt, adapt, addElement, addElement, addElement, clear, createElement, createElement, eq, equals, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hashCode, hasTextValue, isLocked, lock, narrow, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, sameClassAs, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, validate, visit
public static final ElementKey<java.lang.Void,Workspace> KEY
public static final AttributeKey<java.lang.String> TITLE
public Workspace()
protected Workspace(ElementKey<?,? extends Workspace> key)
protected Workspace(ElementKey<?,? extends Workspace> key, Element source)
Element
instance. Will use the given ElementKey
as the
key for the element.key
- the element key to use for this element.source
- source elementpublic Workspace(TextContent title)
public static void registerMetadata(MetadataRegistry registry)
public java.util.List<Collection> getCollections()
getCollections
in interface IWorkspace
public void addCollection(Collection collection)
collection
- collectionpublic Collection addCollection(java.lang.String collectionUri, java.lang.String title, java.lang.String... acceptedTypes)
addCollection
in interface IWorkspace
public boolean removeCollection(Collection collection)
collection
- collectionpublic boolean hasCollections()
public TextContent getTitle()
public void setTitle(TextContent title)
title
- title or null
to resetpublic boolean hasTitle()
public Element resolve(ElementMetadata<?,?> meta, ValidationContext vc)
Element