Package org.mozilla.javascript.xmlimpl
Class XMLCtor
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.javascript.BaseFunction
-
- org.mozilla.javascript.IdFunctionObject
-
- org.mozilla.javascript.xmlimpl.XMLCtor
-
- All Implemented Interfaces:
java.io.Serializable
,Callable
,ConstProperties
,DebuggableObject
,Function
,IdFunctionCall
,Scriptable
,SymbolScriptable
class XMLCtor extends IdFunctionObject
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static int
Id_defaultSettings
private static int
Id_ignoreComments
private static int
Id_ignoreProcessingInstructions
private static int
Id_ignoreWhitespace
private static int
Id_prettyIndent
private static int
Id_prettyPrinting
private static int
Id_setSettings
private static int
Id_settings
private static int
MAX_FUNCTION_ID
private static int
MAX_INSTANCE_ID
private XmlProcessor
options
(package private) static long
serialVersionUID
private static java.lang.Object
XMLCTOR_TAG
-
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned.protected int
findInstanceIdInfo(java.lang.String s)
Map name to id of instance property.protected int
findPrototypeId(java.lang.String s)
protected java.lang.String
getInstanceIdName(int id)
Map id back to property name it defines.protected java.lang.Object
getInstanceIdValue(int id)
Get id value.protected int
getMaxInstanceId()
Get maximum id findInstanceIdInfo can generate.boolean
hasInstance(Scriptable instance)
hasInstance for XML objects works differently than other objects; see ECMA357 13.4.3.10.protected void
initPrototypeId(int id)
private void
readSettings(Scriptable source)
protected void
setInstanceIdValue(int id, java.lang.Object value)
Set or delete id value.private void
writeSetting(Scriptable target)
-
Methods inherited from class org.mozilla.javascript.IdFunctionObject
addAsProperty, call, createObject, exportAsScopeProperty, getArity, getFunctionName, getLength, getPrototype, getTag, hasTag, initFunction, markAsConstructor, methodId, unknown
-
Methods inherited from class org.mozilla.javascript.BaseFunction
construct, fillConstructorProperties, getClassName, getClassPrototype, getPrototypeProperty, getTypeOf, hasPrototypeProperty, isGeneratorFunction, setImmunePrototypeProperty, setInstanceIdAttributes
-
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, exportAsJSClass, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes
-
Methods inherited from class org.mozilla.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mozilla.javascript.Scriptable
delete, delete, get, get, getDefaultValue, getIds, getParentScope, has, has, put, put, setParentScope, setPrototype
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
XMLCTOR_TAG
private static final java.lang.Object XMLCTOR_TAG
-
options
private XmlProcessor options
-
Id_ignoreComments
private static final int Id_ignoreComments
- See Also:
- Constant Field Values
-
Id_ignoreProcessingInstructions
private static final int Id_ignoreProcessingInstructions
- See Also:
- Constant Field Values
-
Id_ignoreWhitespace
private static final int Id_ignoreWhitespace
- See Also:
- Constant Field Values
-
Id_prettyIndent
private static final int Id_prettyIndent
- See Also:
- Constant Field Values
-
Id_prettyPrinting
private static final int Id_prettyPrinting
- See Also:
- Constant Field Values
-
MAX_INSTANCE_ID
private static final int MAX_INSTANCE_ID
- See Also:
- Constant Field Values
-
Id_defaultSettings
private static final int Id_defaultSettings
- See Also:
- Constant Field Values
-
Id_settings
private static final int Id_settings
- See Also:
- Constant Field Values
-
Id_setSettings
private static final int Id_setSettings
- See Also:
- Constant Field Values
-
MAX_FUNCTION_ID
private static final int MAX_FUNCTION_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XMLCtor
XMLCtor(XML xml, java.lang.Object tag, int id, int arity)
-
-
Method Detail
-
writeSetting
private void writeSetting(Scriptable target)
-
readSettings
private void readSettings(Scriptable source)
-
getMaxInstanceId
protected int getMaxInstanceId()
Description copied from class:IdScriptableObject
Get maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceId
in classBaseFunction
-
findInstanceIdInfo
protected int findInstanceIdInfo(java.lang.String s)
Description copied from class:IdScriptableObject
Map name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int)
.- Overrides:
findInstanceIdInfo
in classBaseFunction
-
getInstanceIdName
protected java.lang.String getInstanceIdName(int id)
Description copied from class:IdScriptableObject
Map id back to property name it defines.- Overrides:
getInstanceIdName
in classBaseFunction
-
getInstanceIdValue
protected java.lang.Object getInstanceIdValue(int id)
Description copied from class:IdScriptableObject
Get id value. If id value is constant, descendant can call cacheIdValue to store value in the permanent cache. Default implementation creates IdFunctionObject instance for given id and cache its value- Overrides:
getInstanceIdValue
in classBaseFunction
-
setInstanceIdValue
protected void setInstanceIdValue(int id, java.lang.Object value)
Description copied from class:IdScriptableObject
Set or delete id value. If value == NOT_FOUND , the implementation should make sure that the following getInstanceIdValue return NOT_FOUND.- Overrides:
setInstanceIdValue
in classBaseFunction
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeId
in classBaseFunction
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeId
in classBaseFunction
-
execIdCall
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Description copied from class:IdScriptableObject
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned.- Specified by:
execIdCall
in interfaceIdFunctionCall
- Overrides:
execIdCall
in classBaseFunction
-
hasInstance
public boolean hasInstance(Scriptable instance)
hasInstance for XML objects works differently than other objects; see ECMA357 13.4.3.10.- Specified by:
hasInstance
in interfaceScriptable
- Overrides:
hasInstance
in classBaseFunction
- Parameters:
instance
- The value that appeared on the LHS of the instanceof operator- Returns:
- true if the "prototype" property of "this" appears in value's prototype chain
-
-