Package org.mozilla.javascript.xmlimpl
Class XML
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable,ConstProperties,DebuggableObject,IdFunctionCall,Scriptable,SymbolScriptable
class XML extends XMLObjectImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private XmlNodenode(package private) static longserialVersionUID-
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
-
-
Constructor Summary
Constructors Constructor Description XML(XMLLibImpl lib, Scriptable scope, XMLObject prototype, XmlNode node)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private XmlNode.Namespaceadapt(Namespace ns)private voidaddInScopeNamespace(Namespace ns)(package private) voidaddMatches(XMLList rv, XMLName name)(package private) XMLaddNamespace(Namespace ns)(package private) XMLappendChild(java.lang.Object xml)(package private) XMLListchild(int index)(package private) XMLListchild(XMLName xmlName)(package private) intchildIndex()(package private) XMLListchildren()(package private) XMLListcomments()(package private) booleancontains(java.lang.Object xml)(package private) XMLObjectImplcopy()voiddelete(int index)Removes the indexed property from the object.(package private) voiddeleteXMLProperty(XMLName name)ecmaDelete(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.(package private) java.lang.StringecmaClass()private java.lang.StringecmaToString()private java.lang.StringecmaValue()(package private) XMLListelements(XMLName name)(package private) booleanequivalentXml(java.lang.Object target)Test XML equality with target the target.java.lang.Objectget(int index, Scriptable start)Returns the value of the indexed property or NOT_FOUND.(package private) XmlNodegetAnnotation()(package private) XML[]getAttributes()private intgetChildIndexOf(XML child)(package private) XML[]getChildren()java.lang.StringgetClassName()Return the name of the class.ScriptablegetExtraMethodSource(Context cx)Return an additional object to look for methods that runtime should consider during method search.java.lang.Object[]getIds()Returns an array of ids for the properties of the object.(package private) XMLgetLastXmlChild()(package private) XmlNode.QNamegetNodeQname()private XmlNode[]getNodesForInsert(java.lang.Object value)(package private) XMLListgetPropertyList(XMLName name)(package private) XMLgetXML()(package private) XMLgetXmlChild(int index)(package private) java.lang.ObjectgetXMLProperty(XMLName xmlName)ecmaGet(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.booleanhas(int index, Scriptable start)Returns true if the property index is defined.(package private) booleanhasComplexContent()(package private) booleanhasOwnProperty(XMLName xmlName)(package private) booleanhasSimpleContent()(package private) booleanhasXMLProperty(XMLName xmlName)ecmaHas(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.(package private) voidinitialize(XmlNode node)(package private) Namespace[]inScopeNamespaces()(package private) XMLinsertChildAfter(XML child, java.lang.Object xml)(package private) XMLinsertChildBefore(XML child, java.lang.Object xml)(package private) booleanis(XML other)(package private) booleanisAttribute()(package private) booleanisComment()(package private) booleanisElement()(package private) booleanisProcessingInstruction()(package private) booleanisText()protected java.lang.ObjectjsConstructor(Context cx, boolean inNewExpr, java.lang.Object[] args)(package private) intlength()(package private) java.lang.StringlocalName()(package private) XMLmakeXmlFromString(XMLName name, java.lang.String value)(package private) QNamename()(package private) Namespacenamespace(java.lang.String prefix)(package private) Namespace[]namespaceDeclarations()(package private) java.lang.ObjectnodeKind()(package private) voidnormalize()(package private) java.lang.Objectparent()(package private) XMLprependChild(java.lang.Object xml)(package private) XMLListprocessingInstructions(XMLName xmlName)(package private) booleanpropertyIsEnumerable(java.lang.Object name)voidput(int index, Scriptable start, java.lang.Object value)Sets the value of the indexed property, creating it if need be.(package private) voidputXMLProperty(XMLName xmlName, java.lang.Object value)ecmaPut(cx, id, value) calls this after resolving when id to XMLName and checking it is not Uint32 index.(package private) voidremove()(package private) voidremoveChild(int index)(package private) XMLremoveNamespace(Namespace ns)(package private) XMLreplace(int index, java.lang.Object xml)(package private) XMLreplace(XMLName xmlName, java.lang.Object xml)(package private) voidreplaceWith(XML value)(package private) voidsetAttribute(XMLName xmlName, java.lang.Object value)(package private) XMLsetChildren(java.lang.Object xml)(package private) voidsetLocalName(java.lang.String localName)(package private) voidsetName(QName name)(package private) voidsetNamespace(Namespace ns)(package private) XMLListtext()(package private) org.w3c.dom.NodetoDomNode()(package private) java.lang.StringtoSource(int indent)java.lang.StringtoString()private XMLtoXML(XmlNode node)(package private) java.lang.StringtoXMLString()(package private) java.lang.ObjectvalueOf()-
Methods inherited from class org.mozilla.javascript.xmlimpl.XMLObjectImpl
addValues, createEmptyXML, createNamespace, createNamespaces, delete, delete, ecmaEscapeAttributeValue, ecmaToXml, enterDotQuery, enterWith, equivalentValues, execIdCall, exportAsJSClass, findPrototypeId, get, get, getDefaultValue, getFunctionProperty, getFunctionProperty, getLib, getParentScope, getProcessor, getPrototype, has, has, hasInstance, initialize, initPrototypeId, isPrototype, memberRef, memberRef, newQName, newQName, newTextElementXML, newXML, newXMLFromJs, newXMLList, newXMLListFrom, put, put, setParentScope, setPrototype, xmlFromNode
-
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findInstanceIdInfo, findPrototypeId, get, getAttributes, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getOwnPropertyDescriptor, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
-
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, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getProperty, getProperty, getProperty, getPropertyIds, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, size
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
node
private XmlNode node
-
-
Constructor Detail
-
XML
XML(XMLLibImpl lib, Scriptable scope, XMLObject prototype, XmlNode node)
-
-
Method Detail
-
initialize
void initialize(XmlNode node)
-
getXML
final XML getXML()
- Specified by:
getXMLin classXMLObjectImpl
-
replaceWith
void replaceWith(XML value)
-
getAnnotation
XmlNode getAnnotation()
-
get
public java.lang.Object get(int index, Scriptable start)Description copied from class:ScriptableObjectReturns the value of the indexed property or NOT_FOUND.- Specified by:
getin interfaceScriptable- Overrides:
getin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
Scriptable.get(String,Scriptable)
-
has
public boolean has(int index, Scriptable start)Description copied from class:ScriptableObjectReturns true if the property index is defined.- Specified by:
hasin interfaceScriptable- Overrides:
hasin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
- See Also:
Scriptable.get(int, Scriptable),ScriptableObject.getProperty(Scriptable, int)
-
put
public void put(int index, Scriptable start, java.lang.Object value)Description copied from class:ScriptableObjectSets the value of the indexed property, creating it if need be.- Specified by:
putin interfaceScriptable- Overrides:
putin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
Scriptable.has(int, Scriptable),Scriptable.get(int, Scriptable),ScriptableObject.putProperty(Scriptable, int, Object),Context.toObject(Object, Scriptable)
-
getIds
public java.lang.Object[] getIds()
Description copied from class:ScriptableObjectReturns an array of ids for the properties of the object.Any properties with the attribute DONTENUM are not listed.
- Specified by:
getIdsin interfaceScriptable- Overrides:
getIdsin classScriptableObject- Returns:
- an array of java.lang.Objects with an entry for every listed property. Properties accessed via an integer index will have a corresponding Integer entry in the returned array. Properties accessed by a String will have a String entry in the returned array.
-
delete
public void delete(int index)
Description copied from class:ScriptableObjectRemoves the indexed property from the object.If the property is not found, or it has the PERMANENT attribute, no action is taken.
- Specified by:
deletein interfaceScriptable- Overrides:
deletein classScriptableObject- Parameters:
index- the numeric index for the property- See Also:
Scriptable.get(int, Scriptable),ScriptableObject.deleteProperty(Scriptable, int)
-
hasXMLProperty
boolean hasXMLProperty(XMLName xmlName)
Description copied from class:XMLObjectImplecmaHas(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.- Specified by:
hasXMLPropertyin classXMLObjectImpl
-
getXMLProperty
java.lang.Object getXMLProperty(XMLName xmlName)
Description copied from class:XMLObjectImplecmaGet(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.- Specified by:
getXMLPropertyin classXMLObjectImpl
-
getNodeQname
XmlNode.QName getNodeQname()
-
getChildren
XML[] getChildren()
-
getAttributes
XML[] getAttributes()
-
deleteXMLProperty
void deleteXMLProperty(XMLName name)
Description copied from class:XMLObjectImplecmaDelete(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.- Specified by:
deleteXMLPropertyin classXMLObjectImpl
-
putXMLProperty
void putXMLProperty(XMLName xmlName, java.lang.Object value)
Description copied from class:XMLObjectImplecmaPut(cx, id, value) calls this after resolving when id to XMLName and checking it is not Uint32 index.- Specified by:
putXMLPropertyin classXMLObjectImpl
-
hasOwnProperty
boolean hasOwnProperty(XMLName xmlName)
- Specified by:
hasOwnPropertyin classXMLObjectImpl
-
jsConstructor
protected java.lang.Object jsConstructor(Context cx, boolean inNewExpr, java.lang.Object[] args)
- Specified by:
jsConstructorin classXMLObjectImpl
-
getExtraMethodSource
public Scriptable getExtraMethodSource(Context cx)
Description copied from class:XMLObjectReturn an additional object to look for methods that runtime should consider during method search. Return null if no such object available.- Specified by:
getExtraMethodSourcein classXMLObject
-
removeChild
void removeChild(int index)
-
normalize
void normalize()
- Specified by:
normalizein classXMLObjectImpl
-
setAttribute
void setAttribute(XMLName xmlName, java.lang.Object value)
-
remove
void remove()
-
addMatches
void addMatches(XMLList rv, XMLName name)
- Specified by:
addMatchesin classXMLObjectImpl
-
elements
XMLList elements(XMLName name)
- Specified by:
elementsin classXMLObjectImpl
-
child
XMLList child(XMLName xmlName)
- Specified by:
childin classXMLObjectImpl
-
children
XMLList children()
- Specified by:
childrenin classXMLObjectImpl
-
child
XMLList child(int index)
- Specified by:
childin classXMLObjectImpl
-
getXmlChild
XML getXmlChild(int index)
-
getLastXmlChild
XML getLastXmlChild()
-
childIndex
int childIndex()
-
contains
boolean contains(java.lang.Object xml)
- Specified by:
containsin classXMLObjectImpl
-
equivalentXml
boolean equivalentXml(java.lang.Object target)
Description copied from class:XMLObjectImplTest XML equality with target the target.- Specified by:
equivalentXmlin classXMLObjectImpl
-
copy
XMLObjectImpl copy()
- Specified by:
copyin classXMLObjectImpl
-
hasSimpleContent
boolean hasSimpleContent()
- Specified by:
hasSimpleContentin classXMLObjectImpl
-
hasComplexContent
boolean hasComplexContent()
- Specified by:
hasComplexContentin classXMLObjectImpl
-
length
int length()
- Specified by:
lengthin classXMLObjectImpl
-
is
boolean is(XML other)
-
nodeKind
java.lang.Object nodeKind()
-
parent
java.lang.Object parent()
- Specified by:
parentin classXMLObjectImpl
-
propertyIsEnumerable
boolean propertyIsEnumerable(java.lang.Object name)
- Specified by:
propertyIsEnumerablein classXMLObjectImpl
-
valueOf
java.lang.Object valueOf()
- Specified by:
valueOfin classXMLObjectImpl
-
comments
XMLList comments()
- Specified by:
commentsin classXMLObjectImpl
-
text
XMLList text()
- Specified by:
textin classXMLObjectImpl
-
processingInstructions
XMLList processingInstructions(XMLName xmlName)
- Specified by:
processingInstructionsin classXMLObjectImpl
-
getNodesForInsert
private XmlNode[] getNodesForInsert(java.lang.Object value)
-
replace
XML replace(int index, java.lang.Object xml)
-
prependChild
XML prependChild(java.lang.Object xml)
-
appendChild
XML appendChild(java.lang.Object xml)
-
getChildIndexOf
private int getChildIndexOf(XML child)
-
setChildren
XML setChildren(java.lang.Object xml)
-
addInScopeNamespace
private void addInScopeNamespace(Namespace ns)
-
inScopeNamespaces
Namespace[] inScopeNamespaces()
-
adapt
private XmlNode.Namespace adapt(Namespace ns)
-
name
QName name()
-
namespaceDeclarations
Namespace[] namespaceDeclarations()
-
namespace
Namespace namespace(java.lang.String prefix)
-
localName
java.lang.String localName()
-
setLocalName
void setLocalName(java.lang.String localName)
-
setName
void setName(QName name)
-
setNamespace
void setNamespace(Namespace ns)
-
ecmaClass
final java.lang.String ecmaClass()
-
getClassName
public java.lang.String getClassName()
Description copied from class:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
ecmaValue
private java.lang.String ecmaValue()
-
ecmaToString
private java.lang.String ecmaToString()
-
toString
public java.lang.String toString()
- Specified by:
toStringin classXMLObjectImpl
-
toSource
java.lang.String toSource(int indent)
- Specified by:
toSourcein classXMLObjectImpl
-
toXMLString
java.lang.String toXMLString()
- Specified by:
toXMLStringin classXMLObjectImpl
-
isAttribute
final boolean isAttribute()
-
isComment
final boolean isComment()
-
isText
final boolean isText()
-
isElement
final boolean isElement()
-
isProcessingInstruction
final boolean isProcessingInstruction()
-
toDomNode
org.w3c.dom.Node toDomNode()
-
-