org.nuxeo.ecm.platform.rendering.api
Class DefaultDocumentView
java.lang.Object
org.nuxeo.ecm.platform.rendering.api.DefaultDocumentView
- All Implemented Interfaces:
- DocumentView
public class DefaultDocumentView
- extends java.lang.Object
- implements DocumentView
Base class to build views for Document oriented contexts (contexts that are
bound to a document)
Note that this class cannot be used with contexts for which the
RenderingContext#getDocument()
method is returning null.
This implementation ensure that the context argument is never used so it can
be used outside the scope of a rendering context to get a view over the
document.
- Author:
- Bogdan Stefanescu
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNKNOWN
public static final java.lang.Object UNKNOWN
DEFAULT
public static final DefaultDocumentView DEFAULT
- The singleton instance that should be used by clients. Warn that this
static field must be defined at the end of the class after any other
field class since it will try to register these fields (otherwise fields
will not be defined yet at the time of the initialization of that static
member
DefaultDocumentView
public DefaultDocumentView()
DefaultDocumentView
public DefaultDocumentView(java.util.Map<java.lang.String,DefaultDocumentView.Field> fields)
addField
public final void addField(DefaultDocumentView.Field field)
addFields
public final void addFields(java.util.Collection<DefaultDocumentView.Field> fields)
removeField
public final void removeField(java.lang.String name)
getField
public DefaultDocumentView.Field getField(java.lang.String name)
get
public java.lang.Object get(DocumentModel doc,
java.lang.String name)
throws java.lang.Exception
- Specified by:
get
in interface DocumentView
- Throws:
java.lang.Exception
keys
public java.util.Collection<java.lang.String> keys(DocumentModel doc)
- Specified by:
keys
in interface DocumentView
getFields
public java.util.Map<java.lang.String,DefaultDocumentView.Field> getFields()
isEmpty
public boolean isEmpty()
size
public int size(DocumentModel doc)
Copyright © 2010 Nuxeo SAS. All Rights Reserved.