com.caucho.quercus.lib.simplexml
Class SimpleXMLAttribute

java.lang.Object
  extended by com.caucho.quercus.lib.simplexml.SimpleXMLElement
      extended by com.caucho.quercus.lib.simplexml.SimpleXMLAttribute
All Implemented Interfaces:
java.util.Map.Entry<java.lang.String,java.lang.Object>
Direct Known Subclasses:
SimpleXMLNamespaceAttribute

public class SimpleXMLAttribute
extends SimpleXMLElement

SimpleXMLElement object oriented API facade. Also acts as the DOM document.


Field Summary
 
Fields inherited from class com.caucho.quercus.lib.simplexml.SimpleXMLElement
_attributes, _children, _cls, _env, _name, _namespace, _namespaceMap, _parent, _prefix, _text
 
Constructor Summary
protected SimpleXMLAttribute(Env env, QuercusClass cls, SimpleXMLElement parent, java.lang.String name)
           
protected SimpleXMLAttribute(Env env, QuercusClass cls, SimpleXMLElement parent, java.lang.String name, java.lang.String namespace, StringValue text)
           
 
Method Summary
 Value __get(Env env, Value indexV)
          Implementation for getting the indices of this class.
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.
 StringValue asXML(Env env)
          Converts node tree to a valid xml string.
 java.util.Iterator iterator()
          Required for 'foreach'.
protected  void jsonEncodeImpl(Env env, StringValue sb, boolean isTop)
           
protected  void toXMLImpl(StringValue sb)
           
 
Methods inherited from class com.caucho.quercus.lib.simplexml.SimpleXMLElement
__construct, __count, __getField, __set, __setField, __toString, addAttribute, addAttribute, addChild, addText, attributes, children, create, entrySet, getAttribute, getDocNamespaces, getKey, getName, getNamespace, getNamespace, getNamespaces, getOwner, getQuercusClass, getValue, hasNamespace, isElement, isNamespaceAttribute, isSameNamespace, isSamePrefix, jsonEncode, printDepth, setQuercusClass, setText, setValue, simplexml_getName, toXML, varDumpImpl, wrapJava, xpath
 
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
 

Constructor Detail

SimpleXMLAttribute

protected SimpleXMLAttribute(Env env,
                             QuercusClass cls,
                             SimpleXMLElement parent,
                             java.lang.String name)

SimpleXMLAttribute

protected SimpleXMLAttribute(Env env,
                             QuercusClass cls,
                             SimpleXMLElement parent,
                             java.lang.String name,
                             java.lang.String namespace,
                             StringValue text)
Method Detail

addNamespace

protected void addNamespace(java.lang.String prefix,
                            java.lang.String namespace)
Overrides:
addNamespace in class SimpleXMLElement

addNamespaceAttribute

protected void addNamespaceAttribute(Env env,
                                     java.lang.String name,
                                     java.lang.String namespace)
Adds a namespace attribute to this node.

Overrides:
addNamespaceAttribute in class SimpleXMLElement

iterator

public java.util.Iterator iterator()
Required for 'foreach'. When only values are specified in the loop 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.

Overrides:
iterator in class SimpleXMLElement

asXML

public StringValue asXML(Env env)
Converts node tree to a valid xml string.

Overrides:
asXML in class SimpleXMLElement
Returns:
xml string

toXMLImpl

protected void toXMLImpl(StringValue sb)
Overrides:
toXMLImpl in class SimpleXMLElement

__get

public Value __get(Env env,
                   Value indexV)
Implementation for getting the indices of this class. i.e. $a->foo[0]

Overrides:
__get in class SimpleXMLElement

jsonEncodeImpl

protected void jsonEncodeImpl(Env env,
                              StringValue sb,
                              boolean isTop)
Overrides:
jsonEncodeImpl in class SimpleXMLElement