public class View extends Object implements JSONSerializable
Constructor and Description |
---|
View(String viewId,
String lang,
String dir,
String featureId,
java.util.Map<String,Object> clientState)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Object |
getClientState(Node node)
Get the client state for a given node
|
static View |
getInstance(String featureId)
Get the current view from the view scope
|
Object |
getKey(String stampKey)
Given a string version of the stamp key, get the embedded key object
|
String |
getLanguage()
Returns the language set on the web view document element
|
Node |
getNodeById(String nodeId)
Find a node by its ID.
|
static oracle.maf.impl.amx.NodeChangesTracker |
getNodeChangesTracker(String featureId)
Convenience method to get the current node change tracker
|
Node |
getRootNode() |
String |
getStampForId(String stampKey)
Get a stamp key that is escaped to be valid for inclusion in an HTML ID attribute
|
String |
getStampKey(Object key)
Get a stamp key for a stamp object.
|
TagImpl |
getTagForViewId(String viewId)
Get a tag for a nested view ID using caching.
|
String |
getViewId() |
static boolean |
isAmxView(TagImpl tag)
Checks if the tag is an AMX view tag.
|
boolean |
isLeftToRight()
Checks if the current language is rendered left-to-right
|
boolean |
isRightToLeft()
Checks if the current language is rendered right-to-left
|
void |
nodeAdded(Node node)
Call when a node is added to the view to be able to update the ID map
|
void |
nodeRemoved(Node node)
Call when a node is removed from the view to be able to update the ID map
|
boolean |
registerTag(TagImpl tag)
Registers that a tag is being used by the view.
|
Object |
setClientState(Node node,
Object state)
Set the client state for a node
|
void |
setRootNode(Node rootNode)
Sets the root node
|
void |
tearDown()
Perform any clean up needed when a view is being disposed
|
Object |
toJSON()
Returns an empy JSON object to prevent this class from being serialized to the WebView
|
public View(String viewId, String lang, String dir, String featureId, java.util.Map<String,Object> clientState)
viewId
- the ID of the view, the one requested by the clientclientState
- the client statelang
- the language set on the documentdirection
- the value of the 'dir' HTML attributefeatureId
- the ID of the featurepublic static View getInstance(String featureId)
featureId
- the ID of the feature for the viewpublic static boolean isAmxView(TagImpl tag)
public boolean isRightToLeft()
public boolean isLeftToRight()
public String getLanguage()
public String getViewId()
public Node getRootNode()
public void setRootNode(Node rootNode)
rootNode
- the root nodepublic Node getNodeById(String nodeId)
nodeId
- the node IDpublic void nodeAdded(Node node)
node
- the added nodepublic void nodeRemoved(Node node)
node
- the added nodepublic Object getClientState(Node node)
node
- the nodepublic Object setClientState(Node node, Object state)
node
- the nodestate
- the state of the nodepublic void tearDown()
public Object toJSON() throws Exception
toJSON
in interface JSONSerializable
Exception
public String getStampKey(Object key)
key
- the stamppublic String getStampForId(String stampKey)
stampKey
- the string version of a stamp key from getStampKey(Object)
public Object getKey(String stampKey)
stampKey
- the client safe string version of the keypublic boolean registerTag(TagImpl tag)
tag
- the tag that may be newpublic TagImpl getTagForViewId(String viewId)
viewId
- the view ID of the fragmentpublic static oracle.maf.impl.amx.NodeChangesTracker getNodeChangesTracker(String featureId)