001 package railo.runtime.text.xml.struct; 002 003 import org.w3c.dom.Attr; 004 import org.w3c.dom.DOMException; 005 import org.w3c.dom.Element; 006 import org.w3c.dom.Node; 007 import org.w3c.dom.TypeInfo; 008 009 import railo.runtime.type.Collection; 010 011 /** 012 * 013 */ 014 public final class XMLAttrStruct extends XMLNodeStruct implements Attr { 015 016 private Attr attr; 017 018 /** 019 * constructor of the class 020 * @param section 021 * @param caseSensitive 022 */ 023 public XMLAttrStruct(Attr attr, boolean caseSensitive) { 024 super(attr,caseSensitive); 025 this.attr=attr; 026 } 027 028 /** 029 * @see org.w3c.dom.Attr#getName() 030 */ 031 public String getName() { 032 return attr.getName(); 033 } 034 035 /** 036 * @see org.w3c.dom.Attr#getOwnerElement() 037 */ 038 public Element getOwnerElement() { 039 return new XMLElementStruct(attr.getOwnerElement(),caseSensitive); 040 } 041 042 /** 043 * @see org.w3c.dom.Attr#getSpecified() 044 */ 045 public boolean getSpecified() { 046 return attr.getSpecified(); 047 } 048 049 /** 050 * @see org.w3c.dom.Attr#getValue() 051 */ 052 public String getValue() { 053 return attr.getValue(); 054 } 055 056 /** 057 * @see org.w3c.dom.Attr#setValue(java.lang.String) 058 */ 059 public void setValue(String arg0) throws DOMException { 060 attr.setValue(arg0); 061 } 062 063 /** 064 * @see org.w3c.dom.Attr#getSchemaTypeInfo() 065 */ 066 public TypeInfo getSchemaTypeInfo() { 067 return null; 068 } 069 070 /** 071 * @see org.w3c.dom.Attr#isId() 072 */ 073 public boolean isId() { 074 return false; 075 } 076 077 /** 078 * 079 * @see railo.runtime.type.Collection#duplicate(boolean) 080 */ 081 public Collection duplicate(boolean deepCopy) { 082 return new XMLAttrStruct((Attr)attr.cloneNode(deepCopy),caseSensitive); 083 } 084 085 086 /** 087 * @see org.w3c.dom.Node#cloneNode(boolean) 088 */ 089 public Node cloneNode(boolean deep) { 090 return new XMLAttrStruct((Attr)attr.cloneNode(deep),caseSensitive); 091 } 092 }