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,Constructable,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 intId_defaultSettingsprivate static intId_ignoreCommentsprivate static intId_ignoreProcessingInstructionsprivate static intId_ignoreWhitespaceprivate static intId_prettyIndentprivate static intId_prettyPrintingprivate static intId_setSettingsprivate static intId_settingsprivate static intMAX_FUNCTION_IDprivate static intMAX_INSTANCE_IDprivate XmlProcessoroptions(package private) static longserialVersionUIDprivate static java.lang.ObjectXMLCTOR_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.ObjectexecIdCall(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 intfindInstanceIdInfo(java.lang.String s)Map name to id of instance property.protected intfindPrototypeId(java.lang.String s)protected java.lang.StringgetInstanceIdName(int id)Map id back to property name it defines.protected java.lang.ObjectgetInstanceIdValue(int id)Get id value.protected intgetMaxInstanceId()Get maximum id findInstanceIdInfo can generate.booleanhasInstance(Scriptable instance)hasInstance for XML objects works differently than other objects; see ECMA357 13.4.3.10.protected voidinitPrototypeId(int id)private voidreadSettings(Scriptable source)protected voidsetInstanceIdValue(int id, java.lang.Object value)Set or delete id value.private voidwriteSetting(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, setPrototypeProperty, setPrototypePropertyAttributes, setStandardPropertyAttributes, setupDefaultPrototype
-
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, 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, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, 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, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, 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:IdScriptableObjectGet maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceIdin classBaseFunction
-
findInstanceIdInfo
protected int findInstanceIdInfo(java.lang.String s)
Description copied from class:IdScriptableObjectMap name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int).- Overrides:
findInstanceIdInfoin classBaseFunction
-
getInstanceIdName
protected java.lang.String getInstanceIdName(int id)
Description copied from class:IdScriptableObjectMap id back to property name it defines.- Overrides:
getInstanceIdNamein classBaseFunction
-
getInstanceIdValue
protected java.lang.Object getInstanceIdValue(int id)
Description copied from class:IdScriptableObjectGet 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:
getInstanceIdValuein classBaseFunction
-
setInstanceIdValue
protected void setInstanceIdValue(int id, java.lang.Object value)Description copied from class:IdScriptableObjectSet or delete id value. If value == NOT_FOUND , the implementation should make sure that the following getInstanceIdValue return NOT_FOUND.- Overrides:
setInstanceIdValuein classBaseFunction
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeIdin classBaseFunction
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeIdin 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:
execIdCallin interfaceIdFunctionCall- Overrides:
execIdCallin classBaseFunction
-
hasInstance
public boolean hasInstance(Scriptable instance)
hasInstance for XML objects works differently than other objects; see ECMA357 13.4.3.10.- Specified by:
hasInstancein interfaceScriptable- Overrides:
hasInstancein 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
-
-