Package com.adobe.xfa
Class ModelFactory
java.lang.Object
com.adobe.xfa.ModelFactory
- Direct Known Subclasses:
ConfigurationModelFactory,ConnectionSetModelFactory,DataModelFactory,LocaleSetModelFactory,TemplateModelFactory
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ModelCreate the XML DOM node and the corresponding XFA Model.booleanDetermines whether the class of Model that this ModelFactory creates allows parsing a duplicate model that is added to an existing model.booleanisRootName(String name) final StringrootName()Returns the root name of the factory.voidSets an option
-
Constructor Details
-
ModelFactory
-
-
Method Details
-
rootName
Returns the root name of the factory.- Returns:
- the name of the root as an atom
-
setOption
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
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
- Parameters:
name- the name to be tested. This string must be interned.
-