@Entity public class ViewInstanceEntity extends Object
Modifier and Type | Field and Description |
---|---|
static String |
VIEWS_CONTEXT_PATH_PREFIX
The prefix for every view instance context path.
|
Constructor and Description |
---|
ViewInstanceEntity() |
ViewInstanceEntity(ViewEntity view,
InstanceConfig instanceConfig)
Construct a view instance definition.
|
ViewInstanceEntity(ViewEntity view,
String name)
Construct a view instance definition.
|
Modifier and Type | Method and Description |
---|---|
void |
addResourceProvider(Resource.Type type,
ResourceProvider provider)
Add a resource provider for the given resource type.
|
void |
addService(String pluralName,
Object service)
Add a service for the given plural resource name.
|
InstanceConfig |
getConfiguration()
Get the associated configuration.
|
String |
getContextPath()
Get the context path for the UI for this view.
|
static String |
getContextPath(String viewName,
String viewInstanceName)
Get the context path for a view instance with the given names.
|
Collection<ViewInstanceDataEntity> |
getData()
Get the instance data.
|
ViewInstanceDataEntity |
getInstanceData(String key)
Get the instance data entity for the given key.
|
Map<String,String> |
getInstanceDataMap()
Get the view instance application data.
|
String |
getName()
Get the name of this instance.
|
Collection<ViewInstancePropertyEntity> |
getProperties()
Get the instance properties.
|
ViewInstancePropertyEntity |
getProperty(String key)
Get the instance property entity for the given key.
|
Map<String,String> |
getPropertyMap()
Get the instance property map.
|
ResourceProvider |
getResourceProvider(Resource.Type type)
Get the resource provider for the given resource type.
|
ResourceProvider |
getResourceProvider(String type)
Get the resource provider for the given resource type name (scoped to this view).
|
Object |
getService(String pluralName)
Get the service associated with the given plural resource name.
|
ViewEntity |
getViewEntity()
Get the parent view entity.
|
String |
getViewName()
Get the view name.
|
void |
putInstanceData(String key,
String value)
Associate the given instance data value with the given key.
|
void |
putProperty(String key,
String value)
Add a property value to this instance.
|
void |
removeInstanceData(String key)
Remove the instance data entity associated with the given key.
|
void |
removeProperty(String key)
Remove the property identified by the given key from this instance.
|
void |
setData(Collection<ViewInstanceDataEntity> data)
Set the collection of instance data entities.
|
void |
setName(String name)
Set the name of this instance.
|
void |
setProperties(Collection<ViewInstancePropertyEntity> properties)
Set the collection of instance property entities.
|
void |
setViewEntity(ViewEntity view)
Set the parent view entity.
|
void |
setViewName(String viewName)
Set the view name.
|
public static final String VIEWS_CONTEXT_PATH_PREFIX
public ViewInstanceEntity()
public ViewInstanceEntity(ViewEntity view, InstanceConfig instanceConfig)
view
- the parent view definitioninstanceConfig
- the associated configurationpublic ViewInstanceEntity(ViewEntity view, String name)
view
- the parent view definitionname
- the instance namepublic String getViewName()
public void setViewName(String viewName)
viewName
- the view namepublic String getName()
public void setName(String name)
name
- the instance namepublic Collection<ViewInstancePropertyEntity> getProperties()
public Map<String,String> getPropertyMap()
public void putProperty(String key, String value)
key
- the property keyvalue
- the property valuepublic void removeProperty(String key)
key
- the keypublic ViewInstancePropertyEntity getProperty(String key)
key
- the keypublic void setProperties(Collection<ViewInstancePropertyEntity> properties)
properties
- the collection of instance property entitiespublic Collection<ViewInstanceDataEntity> getData()
public void setData(Collection<ViewInstanceDataEntity> data)
data
- the collection of instance data entitiespublic Map<String,String> getInstanceDataMap()
public void putInstanceData(String key, String value)
key
- the keyvalue
- the valuepublic void removeInstanceData(String key)
key
- the keypublic ViewInstanceDataEntity getInstanceData(String key)
key
- the keypublic ViewEntity getViewEntity()
public void setViewEntity(ViewEntity view)
view
- the parent view entitypublic InstanceConfig getConfiguration()
public void addResourceProvider(Resource.Type type, ResourceProvider provider)
type
- the resource typeprovider
- the resource providerpublic ResourceProvider getResourceProvider(Resource.Type type)
type
- the resource typepublic ResourceProvider getResourceProvider(String type)
type
- the resource type namepublic void addService(String pluralName, Object service)
pluralName
- the plural resource nameservice
- the servicepublic Object getService(String pluralName)
pluralName
- the plural resource namepublic String getContextPath()
Copyright © 2014. All rights reserved.