001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.text.xml.struct; 020 021import lucee.runtime.type.Collection; 022 023import org.w3c.dom.Attr; 024import org.w3c.dom.DOMException; 025import org.w3c.dom.Element; 026import org.w3c.dom.Node; 027import org.w3c.dom.TypeInfo; 028 029/** 030 * 031 */ 032public final class XMLAttrStruct extends XMLNodeStruct implements Attr { 033 034 private Attr attr; 035 036 /** 037 * constructor of the class 038 * @param section 039 * @param caseSensitive 040 */ 041 public XMLAttrStruct(Attr attr, boolean caseSensitive) { 042 super(attr,caseSensitive); 043 this.attr=attr; 044 } 045 046 @Override 047 public String getName() { 048 return attr.getName(); 049 } 050 051 @Override 052 public Element getOwnerElement() { 053 return new XMLElementStruct(attr.getOwnerElement(),caseSensitive); 054 } 055 056 @Override 057 public boolean getSpecified() { 058 return attr.getSpecified(); 059 } 060 061 @Override 062 public String getValue() { 063 return attr.getValue(); 064 } 065 066 @Override 067 public void setValue(String arg0) throws DOMException { 068 attr.setValue(arg0); 069 } 070 071 public TypeInfo getSchemaTypeInfo() { 072 return null; 073 } 074 075 public boolean isId() { 076 return false; 077 } 078 079 @Override 080 public Collection duplicate(boolean deepCopy) { 081 return new XMLAttrStruct((Attr)attr.cloneNode(deepCopy),caseSensitive); 082 } 083 084 085 @Override 086 public Node cloneNode(boolean deep) { 087 return new XMLAttrStruct((Attr)attr.cloneNode(deep),caseSensitive); 088 } 089}