Package com.adobe.xfa

Class ModelFactory

java.lang.Object
com.adobe.xfa.ModelFactory
Direct Known Subclasses:
ConfigurationModelFactory, ConnectionSetModelFactory, DataModelFactory, LocaleSetModelFactory, TemplateModelFactory

public abstract class ModelFactory extends Object
A class to represent model factories. A model factory is used by application models to create a model where appropriate, when loading an XML file. The factory provides interfaces for defining the behaviors of the model once it is created.
  • Constructor Details

    • ModelFactory

      public ModelFactory(int eClassTag, String aRootName, String aShortCutName)
  • Method Details

    • rootName

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

      public void setOption(String optionName, 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.
    • 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(String name)
      Parameters:
      name - the name to be tested. This string must be interned.