public class DefaultDocumentView extends Object implements DocumentView
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.
Modifier and Type | Class and Description |
---|---|
static interface |
DefaultDocumentView.Field |
Modifier and Type | Field and Description |
---|---|
static DefaultDocumentView |
DEFAULT
The singleton instance that should be used by clients.
|
static Object |
UNKNOWN |
Constructor and Description |
---|
DefaultDocumentView() |
DefaultDocumentView(Map<String,DefaultDocumentView.Field> fields) |
Modifier and Type | Method and Description |
---|---|
void |
addField(DefaultDocumentView.Field field) |
void |
addFields(Collection<DefaultDocumentView.Field> fields) |
Object |
get(DocumentModel doc,
String name) |
DefaultDocumentView.Field |
getField(String name) |
Map<String,DefaultDocumentView.Field> |
getFields() |
boolean |
isEmpty() |
Collection<String> |
keys(DocumentModel doc) |
void |
removeField(String name) |
int |
size(DocumentModel doc) |
public static final Object UNKNOWN
public static final DefaultDocumentView DEFAULT
public DefaultDocumentView()
public DefaultDocumentView(Map<String,DefaultDocumentView.Field> fields)
public final void addField(DefaultDocumentView.Field field)
public final void addFields(Collection<DefaultDocumentView.Field> fields)
public final void removeField(String name)
public DefaultDocumentView.Field getField(String name)
public Object get(DocumentModel doc, String name) throws PropertyException
get
in interface DocumentView
PropertyException
public Collection<String> keys(DocumentModel doc)
keys
in interface DocumentView
public Map<String,DefaultDocumentView.Field> getFields()
public boolean isEmpty()
public int size(DocumentModel doc)
Copyright © 2015 Nuxeo SA. All rights reserved.