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