|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.quercus.lib.simplexml.SimpleXMLElement
public class SimpleXMLElement
SimpleXMLElement object oriented API facade. Also acts as the DOM document.
Field Summary | |
---|---|
protected java.util.ArrayList<SimpleXMLElement> |
_attributes
|
protected java.util.ArrayList<SimpleXMLElement> |
_children
|
protected QuercusClass |
_cls
|
protected Env |
_env
|
protected java.lang.String |
_name
|
protected java.lang.String |
_namespace
|
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> |
_namespaceMap
|
protected SimpleXMLElement |
_parent
|
protected java.lang.String |
_prefix
|
protected StringValue |
_text
|
Constructor Summary | |
---|---|
protected |
SimpleXMLElement(Env env,
QuercusClass cls)
|
protected |
SimpleXMLElement(Env env,
QuercusClass cls,
SimpleXMLElement parent,
java.lang.String name)
|
protected |
SimpleXMLElement(Env env,
QuercusClass cls,
SimpleXMLElement parent,
java.lang.String name,
java.lang.String namespace)
|
Method Summary | |
---|---|
static Value |
__construct(Env env,
Value data,
int options,
boolean dataIsUrl,
Value namespaceV,
boolean isPrefix)
Returns a new instance based on the xml from 'data'. |
int |
__count(Env env)
Implementation for getting the indices of this class. |
Value |
__get(Env env,
Value indexV)
Implementation for getting the indices of this class. |
Value |
__getField(java.lang.String name)
Implementation for getting the fields of this class. |
void |
__set(java.lang.String name,
StringValue value)
Implementation for setting the indices of this class. |
void |
__setField(java.lang.String name,
Value value)
Implementation for setting the fields of this class. |
StringValue |
__toString(Env env)
|
void |
addAttribute(Env env,
java.lang.String name,
StringValue value,
java.lang.String namespace)
Adds an attribute to this node. |
protected void |
addAttribute(SimpleXMLElement attr)
Adds an attribute to this node. |
Value |
addChild(Env env,
java.lang.String name,
java.lang.String value,
Value namespaceV)
Adds a child to this node. |
protected void |
addNamespace(java.lang.String prefix,
java.lang.String namespace)
|
protected void |
addNamespaceAttribute(Env env,
java.lang.String name,
java.lang.String namespace)
Adds a namespace attribute to this node. |
protected void |
addText(StringValue text)
|
Value |
asXML(Env env,
Value filename)
Converts node tree to a valid xml string. |
Value |
attributes(Env env,
Value namespaceV,
boolean isPrefix)
Returns the attributes of this node. |
Value |
children(Env env,
Value namespaceV,
boolean isPrefix)
Returns all the children of this node, including the attributes of this node. |
protected static Value |
create(Env env,
QuercusClass cls,
Value data,
int options,
boolean dataIsUrl,
Value namespaceV,
boolean isPrefix)
|
java.util.Set<java.util.Map.Entry<Value,Value>> |
entrySet()
|
protected SimpleXMLElement |
getAttribute(java.lang.String name)
|
Value |
getDocNamespaces(Env env,
boolean isRecursive)
Alias of getNamespaces(). |
java.lang.String |
getKey()
|
protected java.lang.String |
getName()
|
protected java.lang.String |
getNamespace()
|
protected java.lang.String |
getNamespace(java.lang.String prefix)
|
Value |
getNamespaces(Env env,
boolean isRecursive)
Returns the namespaces used in this document. |
protected SimpleXMLElement |
getOwner()
|
protected QuercusClass |
getQuercusClass()
|
java.lang.Object |
getValue()
|
protected boolean |
hasNamespace(java.lang.String prefix,
java.lang.String namespace)
|
protected boolean |
isElement()
|
protected boolean |
isNamespaceAttribute()
|
protected boolean |
isSameNamespace(java.lang.String namespace)
|
protected boolean |
isSamePrefix(java.lang.String prefix)
|
java.util.Iterator |
iterator()
Required for 'foreach'. |
void |
jsonEncode(Env env,
JsonEncodeContext context,
StringValue sb)
|
protected void |
jsonEncodeImpl(Env env,
JsonEncodeContext context,
StringValue sb,
boolean isTop)
|
protected void |
printDepth(WriteStream out,
int depth)
|
protected void |
setQuercusClass(QuercusClass cls)
|
protected void |
setText(StringValue text)
|
java.lang.Object |
setValue(java.lang.Object value)
|
java.lang.String |
simplexml_getName()
Returns the name of the node. |
protected Value |
toXML(Env env)
|
protected void |
toXMLImpl(StringValue sb)
|
void |
varDumpImpl(Env env,
Value obj,
WriteStream out,
int depth,
java.util.IdentityHashMap<Value,java.lang.String> valueSet)
var_dump() implementation |
protected static Value |
wrapJava(Env env,
QuercusClass cls,
SimpleXMLElement element)
|
Value |
xpath(Env env,
java.lang.String expression)
Runs an XPath expression on this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map.Entry |
---|
equals, hashCode |
Field Detail |
---|
protected SimpleXMLElement _parent
protected java.lang.String _name
protected StringValue _text
protected java.util.ArrayList<SimpleXMLElement> _children
protected java.util.ArrayList<SimpleXMLElement> _attributes
protected java.lang.String _namespace
protected java.lang.String _prefix
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> _namespaceMap
protected Env _env
protected QuercusClass _cls
Constructor Detail |
---|
protected SimpleXMLElement(Env env, QuercusClass cls)
protected SimpleXMLElement(Env env, QuercusClass cls, SimpleXMLElement parent, java.lang.String name)
protected SimpleXMLElement(Env env, QuercusClass cls, SimpleXMLElement parent, java.lang.String name, java.lang.String namespace)
Method Detail |
---|
protected static Value create(Env env, QuercusClass cls, Value data, int options, boolean dataIsUrl, Value namespaceV, boolean isPrefix)
protected static Value wrapJava(Env env, QuercusClass cls, SimpleXMLElement element)
protected QuercusClass getQuercusClass()
protected void setQuercusClass(QuercusClass cls)
protected void addNamespace(java.lang.String prefix, java.lang.String namespace)
protected boolean hasNamespace(java.lang.String prefix, java.lang.String namespace)
protected java.lang.String getNamespace(java.lang.String prefix)
public static Value __construct(Env env, Value data, int options, boolean dataIsUrl, Value namespaceV, boolean isPrefix)
env
- data
- xml dataoptions
- dataIsUrl
- namespaceV
- isPrefix
- protected java.lang.String getName()
protected java.lang.String getNamespace()
protected SimpleXMLElement getOwner()
protected boolean isElement()
protected boolean isNamespaceAttribute()
protected void setText(StringValue text)
protected void addText(StringValue text)
protected boolean isSameNamespace(java.lang.String namespace)
protected boolean isSamePrefix(java.lang.String prefix)
protected SimpleXMLElement getAttribute(java.lang.String name)
public java.lang.String getKey()
getKey
in interface java.util.Map.Entry<java.lang.String,java.lang.Object>
public java.lang.Object getValue()
getValue
in interface java.util.Map.Entry<java.lang.String,java.lang.Object>
public java.lang.Object setValue(java.lang.Object value)
setValue
in interface java.util.Map.Entry<java.lang.String,java.lang.Object>
public void addAttribute(Env env, java.lang.String name, StringValue value, java.lang.String namespace)
protected void addNamespaceAttribute(Env env, java.lang.String name, java.lang.String namespace)
protected void addAttribute(SimpleXMLElement attr)
public Value addChild(Env env, java.lang.String name, java.lang.String value, Value namespaceV)
env
- name
- of the child nodevalue
- of the text node of the childnamespace
-
public Value attributes(Env env, Value namespaceV, boolean isPrefix)
env
- namespaceV
- isPrefix
- public Value children(Env env, Value namespaceV, boolean isPrefix)
env
- namespaceV
- isPrefix
- public final Value asXML(Env env, Value filename)
protected Value toXML(Env env)
protected void toXMLImpl(StringValue sb)
public java.lang.String simplexml_getName()
public Value getDocNamespaces(Env env, boolean isRecursive)
public Value getNamespaces(Env env, boolean isRecursive)
public Value xpath(Env env, java.lang.String expression)
env
- expression
-
javax.xml.xpath.XPathExpressionException
public Value __get(Env env, Value indexV)
$a->foo[0]
public void __set(java.lang.String name, StringValue value)
$a->foo[0] = "hello"
public int __count(Env env)
count($a->foo[0])
public Value __getField(java.lang.String name)
$a->foo
public void __setField(java.lang.String name, Value value)
$a->foo = "hello"
public java.util.Iterator iterator()
foreach($a as $b)
, this method
should return an iterator that contains Java objects
that will be wrapped in a Value.
When a 'foreach' loop with name/value pairs
i.e. foreach($a as $b=>$c)
invokes this method, it expects an iterator that
contains objects that implement Map.Entry.
public java.util.Set<java.util.Map.Entry<Value,Value>> entrySet()
public void varDumpImpl(Env env, Value obj, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet) throws java.io.IOException
java.io.IOException
public void jsonEncode(Env env, JsonEncodeContext context, StringValue sb)
protected void jsonEncodeImpl(Env env, JsonEncodeContext context, StringValue sb, boolean isTop)
protected void printDepth(WriteStream out, int depth) throws java.io.IOException
java.io.IOException
public StringValue __toString(Env env)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |