Package com.adobe.xfa
Class Obj
java.lang.Object
com.adobe.xfa.Obj
- All Implemented Interfaces:
Peer
- Direct Known Subclasses:
DataWindow
,Delta
,FormDataListener
,FormItemsDataListener
,FormListener
,InstanceManager
,ListBase
,Node
,PseudoModel
A base class to represent all XFA objects, templates and data.
The methods defined in this class are primarily for use in scripting environments.
-
Field Summary
Fields inherited from interface com.adobe.xfa.ut.Peer
ATTR_CHANGED, CHILD_ADDED, CHILD_REMOVED, DESCENDENT_ADDED, DESCENDENT_ATTR_CHANGED, DESCENDENT_REMOVED, DESCENDENT_VALUE_CHANGED, PARENT_CHANGED, PERMS_LOCK_CLEARED, PERMS_LOCK_SET, PROTO_ATTR_CHANGED, PROTO_CHILD_ADDED, PROTO_CHILD_REMOVED, PROTO_DESCENDENT_ADDED, PROTO_DESCENDENT_ATTR_CHANGED, PROTO_DESCENDENT_REMOVED, PROTO_DESCENDENT_VALUE_CHANGED, PROTO_VALUE_CHANGED, UPDATED, VALUE_CHANGED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Add a peer node to be notified of state changes.final void
addPeeredNode
(Peer poPeer) final void
Removes this node from all peer relationships.final void
deafen()
Makes this peer deaf to any updateFromPeer calls made by notifyPeersReturns the atomic name of this element's class.Gets the name of this object's class.final int
final Peer
getPeer
(int nPeer) Gets the requested peer.getScriptMethodInfo
(String sName) Gets the information on a script method.boolean
getScriptProperty
(Arg retValue, String sPropertyName, DependencyTracker dependencyTracker, boolean bPeek, boolean bSuppressExceptions) Gets the object to be used in concert with getScriptTable() etc.boolean
invokeFunction
(Arg retValue, String sFunctionName, Arg[] parameters, DependencyTracker dependencyTracker, boolean bSuppressExceptions) Call a scripting function (method).final boolean
isDeaf()
Checks if this peer is deaf.final boolean
isMute()
Checks if this peer is mute.final boolean
isSameClass
(int eClassTag) Determine if the class of this object is the same as the class tag.final boolean
isSameClass
(Obj oClass) Determine if the class of this object is the same as the Obj class.final boolean
isSameClass
(String aClass) Determine if the class of this object is the same as the String sClass.final void
mute()
Makes this peer no longer notify its peers when notifyPeers is calledvoid
notifyPeers
(int eventType, String arg1, Object arg2) Sends notification to the peer nodes that this object has changed.void
peerRemoved
(Peer peer) Called when this Peer is removed frompeer
.final void
removePeer
(Peer peerNode) Remove a peer node from the notification list.final void
removePeeredNode
(Peer peer) void
sendMessenge
(ExFull error, int eSeverity) Send message to host so it can be loggedfinal void
Set the class name and class tag for this node instance.final void
setClassTag
(int eClassTag) boolean
setScriptProperty
(String sPropertyName, Arg propertyValue, boolean bSuppressExceptions) final void
unDeafen()
Allows this peer to receive updateFromPeer callsfinal void
unMute()
Allows this peer to notify its peers when notifyPeers is called.void
updateFromPeer
(Object peerNode, int eventType, String arg1, Object arg2) This method will be called by the peer whenever its state changes.boolean
validateUsage
(int nXFAVersion, int nAvailability, boolean bUpdateVersion) Validate if the given Version and Availability flags are valid for the current documentboolean
validateUsageFailedIsFatal
(int nXFAVersion, int nAvailability) Determines if disallowing a version should be considered a fatal error.
-
Constructor Details
-
Obj
public Obj()
-
-
Method Details
-
addPeer
Description copied from interface:Peer
Add a peer node to be notified of state changes. -
addPeeredNode
- Specified by:
addPeeredNode
in interfacePeer
-
clearPeers
public final void clearPeers()Description copied from interface:Peer
Removes this node from all peer relationships.- Specified by:
clearPeers
in interfacePeer
-
deafen
public final void deafen()Description copied from interface:Peer
Makes this peer deaf to any updateFromPeer calls made by notifyPeers -
setClass
Set the class name and class tag for this node instance.- Parameters:
sClassName
- This String must be interned.eClassTag
-
-
setClassTag
public final void setClassTag(int eClassTag) -
getClassTag
public final int getClassTag() -
getClassAtom
Returns the atomic name of this element's class.- Returns:
- the class name as an interned string.
-
getClassName
Gets the name of this object's class. Overriden by derived classes such as Element that have a local name that may be returned instead.- Returns:
- the class name.
-
getPeer
Gets the requested peer. -
getScriptMethodInfo
Gets the information on a script method.- Parameters:
sName
- the name of the method- Returns:
- the script function object or null if not found.
-
getScriptProperty
public boolean getScriptProperty(Arg retValue, String sPropertyName, DependencyTracker dependencyTracker, boolean bPeek, boolean bSuppressExceptions) -
getScriptTable
-
getScriptThis
Gets the object to be used in concert with getScriptTable() etc. It's almost always "this", but it needs to be overridable to support the $record pseudomodel, which redirects all script properties to the current record. Simply overriding getScriptTable and redirecting that call to the current record doesn't work, because when a callback function is invoked, the supplied object pointer would be the pseudo model, not the record. -
invokeFunction
public boolean invokeFunction(Arg retValue, String sFunctionName, Arg[] parameters, DependencyTracker dependencyTracker, boolean bSuppressExceptions) Call a scripting function (method).- Parameters:
sFunctionName
- The name of the function/method to call. If this parameter is an empty string, then an attempt is made to invoke a default function.parameters
- an array of parameters to the method.- Returns:
- the return value of the function.
-
isDeaf
public final boolean isDeaf()Description copied from interface:Peer
Checks if this peer is deaf. -
isMute
public final boolean isMute()Description copied from interface:Peer
Checks if this peer is mute. -
isSameClass
Determine if the class of this object is the same as the Obj class.- Parameters:
oClass
- Obj to check the class with.- Returns:
- true if the classes are the same, else false.
-
isSameClass
Determine if the class of this object is the same as the String sClass. Note: Works only when comparing to the same actual string instance (from the XFA namespace). For example, isSameClass(XFA::nodeTag()) will work if the object in question is an Obj. However, isSameClass("node") will not work even though the two strings are equal. See theSharesImpl
method ofString
.- Parameters:
aClass
- string from the XFA namespace. This String must be interned.- Returns:
- true if the classes are the same, else false.
-
isSameClass
public final boolean isSameClass(int eClassTag) Determine if the class of this object is the same as the class tag.- Parameters:
eClassTag
- string from the XFA namespace.- Returns:
- true if the classes are the same, else false.
-
mute
public final void mute()Description copied from interface:Peer
Makes this peer no longer notify its peers when notifyPeers is called -
notifyPeers
Description copied from interface:Peer
Sends notification to the peer nodes that this object has changed.- Specified by:
notifyPeers
in interfacePeer
- Parameters:
eventType
- the event type as enumerated in this classarg1
- additional event informationarg2
- additional event information
-
removePeer
Remove a peer node from the notification list.- Specified by:
removePeer
in interfacePeer
- Parameters:
peerNode
- The reference to the peer object to be removed.
-
removePeeredNode
- Specified by:
removePeeredNode
in interfacePeer
-
sendMessenge
Send message to host so it can be logged- Parameters:
error
- contains message Id and texteSeverity
- the message severity
-
setScriptProperty
public boolean setScriptProperty(String sPropertyName, Arg propertyValue, boolean bSuppressExceptions) - Parameters:
sPropertyName
- The name of the property to set. If this parameter is an empty string, then an attempt is made to set the default property.propertyValue
- The value of assign to this property.bSuppressExceptions
- If true, quietly return false on error, else throw an exception for any errors.
-
unDeafen
public final void unDeafen()Description copied from interface:Peer
Allows this peer to receive updateFromPeer calls -
unMute
public final void unMute()Description copied from interface:Peer
Allows this peer to notify its peers when notifyPeers is called. -
updateFromPeer
Description copied from interface:Peer
This method will be called by the peer whenever its state changes.eventType (String)arg1 (Object)arg2 UPDATED update type (optional) ATTR_CHANGED attr name (optional) CHILD_ADDED (optional) added node CHILD_REMOVED (optional) removed node VALUE_CHANGED new data (optional) PARENT_CHANGED (optional) new parent DESCENDENT_ATTR_CHANGED attr name changed node DESCENDENT_VALUE_CHANGED (optional) changed node DESCENDENT_ADDED (optional) added node DESCENDENT_REMOVED (optional) removed node PERMS_LOCK_SET (optional) (optional) PERMS_LOCK_CLEARED (optional) (optional) PROTO_ATTR_CHANGED attr name changed node PROTO_CHILD_ADDED (optional) added node of the protoype PROTO_CHILD_REMOVED (optional) removed node from the prototype PROTO_VALUE_CHANGED new data prototype node PROTO_DESCENDENT_ATTR_CHANGED attr name changed prototype node PROTO_DESCENDENT_VALUE_CHANGED (optional) changed prototype node PROTO_DESCENDENT_ADDED (optional) added node to the prototype PROTO_DESCENDENT_REMOVED (optional) removed node from the prototype
- Specified by:
updateFromPeer
in interfacePeer
- Parameters:
peerNode
- the peer to this object.eventType
- the event type as enumerated in this classarg1
- additional event informationarg2
- additional event information
-
peerRemoved
Description copied from interface:Peer
Called when this Peer is removed frompeer
. Derived classes can override this method to receive direct notifications when a peer is removed.- Specified by:
peerRemoved
in interfacePeer
- Parameters:
peer
- the Peer from which this Peer has been removed from notification.
-
validateUsage
public boolean validateUsage(int nXFAVersion, int nAvailability, boolean bUpdateVersion) Validate if the given Version and Availability flags are valid for the current document- Parameters:
nXFAVersion
- The target XFA VersionnAvailability
- The target Availability flags, this indicates for what clients the script is availablebUpdateVersion
- indicates if the model version can be updated by the calling code- Returns:
- if true, Version and Availability flags are valid
-
validateUsageFailedIsFatal
public boolean validateUsageFailedIsFatal(int nXFAVersion, int nAvailability) Determines if disallowing a version should be considered a fatal error.This method is called after calling
validateUsage(int, int, boolean)
when that method returns false.- Parameters:
nXFAVersion
- The target XFA VersionnAvailability
- The target Availability flags, this indicates for what clients the script is available- Returns:
- true if disallowing nVersion should be considered a fatal error
- See Also:
-