Package com.adobe.xfa

Class ModelFactory

    • Constructor Summary

      Constructors 
      Constructor Description
      ModelFactory​(int eClassTag, java.lang.String aRootName, java.lang.String aShortCutName)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract Model createDOM​(Element parent)
      Create the XML DOM node and the corresponding XFA Model.
      boolean getAllowAdd()
      Determines whether the class of Model that this ModelFactory creates allows parsing a duplicate model that is added to an existing model.
      boolean isRootName​(java.lang.String name)  
      java.lang.String rootName()
      Returns the root name of the factory.
      void setOption​(java.lang.String optionName, java.lang.String optionValue, boolean bCritical)
      Sets an option
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModelFactory

        public ModelFactory​(int eClassTag,
                            java.lang.String aRootName,
                            java.lang.String aShortCutName)
    • Method Detail

      • rootName

        public final java.lang.String rootName()
        Returns the root name of the factory.
        Returns:
        the name of the root as an atom
      • setOption

        public void setOption​(java.lang.String optionName,
                              java.lang.String optionValue,
                              boolean bCritical)
        Sets an option
        Parameters:
        optionName - - the name of the option.
        optionValue - - the value of the option.
        bCritical - - disallow further modification of this option.
        Throws:
        InvalidOptionException - since not allowed to set options for this model
      • getAllowAdd

        public boolean getAllowAdd()
        Determines whether the class of Model that this ModelFactory creates allows parsing a duplicate model that is added to an existing model. In C++, this determination is made after the XML DOM is parsed and XMLStorage.loadModel attempts to call Model.add, which by default throws an exception if adding to an existing model isn't supported.
      • createDOM

        public abstract Model createDOM​(Element parent)
        Create the XML DOM node and the corresponding XFA Model. In C++, this only creates the XML DOM node, and a separate step creates the corresponding Model node. In XFA4J, the we don't have the capability of calling AppModel.loadNode to instantiate an XFA Model from the DOM node, so this method is changed to create the XFA model.
        Parameters:
        parent - the XFA DOM node that will be the XML parent of the new DOM peer.
        Returns:
        the XFA Model that was created.
      • isRootName

        public boolean isRootName​(java.lang.String name)
        Parameters:
        name - the name to be tested. This string must be interned.