Package com.adobe.xfa

Class Obj

    • Constructor Detail

      • Obj

        public Obj()
    • Method Detail

      • addPeer

        public final void addPeer​(Peer poPeerNode)
        Description copied from interface: Peer
        Add a peer node to be notified of state changes.
        Specified by:
        addPeer in interface Peer
        Parameters:
        poPeerNode - - The reference to the peer object to be added.
      • addPeeredNode

        public final void addPeeredNode​(Peer poPeer)
        Specified by:
        addPeeredNode in interface Peer
      • clearPeers

        public final void clearPeers()
        Description copied from interface: Peer
        Removes this node from all peer relationships.
        Specified by:
        clearPeers in interface Peer
      • deafen

        public final void deafen()
        Description copied from interface: Peer
        Makes this peer deaf to any updateFromPeer calls made by notifyPeers
        Specified by:
        deafen in interface Peer
      • setClass

        public final void setClass​(java.lang.String sClassName,
                                   int eClassTag)
        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

        public java.lang.String getClassAtom()
        Returns the atomic name of this element's class.
        Returns:
        the class name as an interned string.
      • getClassName

        public java.lang.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

        public final Peer getPeer​(int nPeer)
        Gets the requested peer.
        Specified by:
        getPeer in interface Peer
        Parameters:
        nPeer - the 0-based position of the peer to retrieve.
        Returns:
        the peer at the requested position. When there are not more peers to return, this will return a null object.
      • getScriptMethodInfo

        public ScriptFuncObj getScriptMethodInfo​(java.lang.String sName)
        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,
                                         java.lang.String sPropertyName,
                                         DependencyTracker dependencyTracker,
                                         boolean bPeek,
                                         boolean bSuppressExceptions)
      • getScriptThis

        public Obj 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,
                                      java.lang.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.
        Throws:
        ResId.InvalidMethodException - if the function name is unknown.
        ResId.BadParamCountException - if the number of parameters in nParamCount is not valid for the specified fucntion.
        ResId.ArgumentMismatchException - if one or more of the argument types in pParameters is incorrect for the specified function.
        ResId.NoDefaultMethodException - if sFunctionName is an empty string, and the object doesn't have a default function.
      • isDeaf

        public final boolean isDeaf()
        Description copied from interface: Peer
        Checks if this peer is deaf.
        Specified by:
        isDeaf in interface Peer
        Returns:
        true if this peer does not listen to notifyPeer calls, else false.
      • isMute

        public final boolean isMute()
        Description copied from interface: Peer
        Checks if this peer is mute.
        Specified by:
        isMute in interface Peer
        Returns:
        true if this peer does not notify its peers when notifyPeers is called, else false.
      • isSameClass

        public final boolean isSameClass​(Obj oClass)
        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

        public final boolean isSameClass​(java.lang.String aClass)
        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 the SharesImpl method of String.
        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
        Specified by:
        mute in interface Peer
      • notifyPeers

        public void notifyPeers​(int eventType,
                                java.lang.String arg1,
                                java.lang.Object arg2)
        Description copied from interface: Peer
        Sends notification to the peer nodes that this object has changed.
        Specified by:
        notifyPeers in interface Peer
        Parameters:
        eventType - the event type as enumerated in this class
        arg1 - additional event information
        arg2 - additional event information
      • removePeer

        public final void removePeer​(Peer peerNode)
        Remove a peer node from the notification list.
        Specified by:
        removePeer in interface Peer
        Parameters:
        peerNode - The reference to the peer object to be removed.
      • removePeeredNode

        public final void removePeeredNode​(Peer peer)
        Specified by:
        removePeeredNode in interface Peer
      • sendMessenge

        public void sendMessenge​(ExFull error,
                                 int eSeverity)
        Send message to host so it can be logged
        Parameters:
        error - contains message Id and text
        eSeverity - the message severity
      • setScriptProperty

        public boolean setScriptProperty​(java.lang.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.
        Throws:
        NoDefaultSetPropertyException - if sPropertyName is an empty string, and the object does not have a default property.
        InvalidSetPropertyException - if sPropertyName is not a valid property for the object.
      • unDeafen

        public final void unDeafen()
        Description copied from interface: Peer
        Allows this peer to receive updateFromPeer calls
        Specified by:
        unDeafen in interface Peer
      • unMute

        public final void unMute()
        Description copied from interface: Peer
        Allows this peer to notify its peers when notifyPeers is called.
        Specified by:
        unMute in interface Peer
      • updateFromPeer

        public void updateFromPeer​(java.lang.Object peerNode,
                                   int eventType,
                                   java.lang.String arg1,
                                   java.lang.Object arg2)
        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 interface Peer
        Parameters:
        peerNode - the peer to this object.
        eventType - the event type as enumerated in this class
        arg1 - additional event information
        arg2 - additional event information
      • peerRemoved

        public void peerRemoved​(Peer peer)
        Description copied from interface: Peer
        Called when this Peer is removed from peer. Derived classes can override this method to receive direct notifications when a peer is removed.
        Specified by:
        peerRemoved in interface Peer
        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 Version
        nAvailability - The target Availability flags, this indicates for what clients the script is available
        bUpdateVersion - 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 Version
        nAvailability - 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:
        validateUsage(int, int, boolean)