001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019: package org.netbeans.modules.xslt.model.impl;
020:
021: import java.util.List;
022:
023: import org.netbeans.modules.xslt.model.AttributeSet;
024: import org.netbeans.modules.xslt.model.Copy;
025: import org.netbeans.modules.xslt.model.SequenceElement;
026: import org.netbeans.modules.xslt.model.XslComponent;
027: import org.netbeans.modules.xslt.model.XslReference;
028: import org.netbeans.modules.xslt.model.XslVisitor;
029: import org.netbeans.modules.xslt.model.enums.TBoolean;
030: import org.w3c.dom.Element;
031:
032: /**
033: * @author ads
034: *
035: */
036: class CopyImpl extends ValidationCopyNsSpecImpl implements Copy {
037:
038: CopyImpl(XslModelImpl model, Element element) {
039: super (model, element);
040: }
041:
042: CopyImpl(XslModelImpl model) {
043: super (model, XslElements.COPY);
044: }
045:
046: /* (non-Javadoc)
047: * @see org.netbeans.modules.xslt.model.impl.XslComponentImpl#accept(org.netbeans.modules.xslt.model.XslVisitor)
048: */
049: @Override
050: public void accept(XslVisitor visitor) {
051: visitor.visit(this );
052: }
053:
054: /* (non-Javadoc)
055: * @see org.netbeans.modules.xslt.model.impl.XslComponentImpl#getComponentType()
056: */
057: @Override
058: public Class<? extends XslComponent> getComponentType() {
059: return Copy.class;
060: }
061:
062: /* (non-Javadoc)
063: * @see org.netbeans.modules.xslt.model.UseAttributesSetsSpec#getUseAttributeSets()
064: */
065: public List<XslReference<AttributeSet>> getUseAttributeSets() {
066: return resolveGlobalReferenceList(AttributeSet.class,
067: XslAttributes.USE_ATTRIBUTE_SETS);
068: }
069:
070: /* (non-Javadoc)
071: * @see org.netbeans.modules.xslt.model.UseAttributesSetsSpec#setUseAttributeSets(java.util.Collection)
072: */
073: public void setUseAttributeSets(
074: List<XslReference<AttributeSet>> collection) {
075: setAttributeList(XslAttributes.USE_ATTRIBUTE_SETS, collection);
076: }
077:
078: /* (non-Javadoc)
079: * @see org.netbeans.modules.xslt.model.SequenceConstructor#addSequenceChild(org.netbeans.modules.xslt.model.SequenceElement, int)
080: */
081: public void addSequenceChild(SequenceElement element, int position) {
082: insertAtIndex(SEQUENCE_ELEMENT, element, position);
083: }
084:
085: /* (non-Javadoc)
086: * @see org.netbeans.modules.xslt.model.SequenceConstructor#appendSequenceChild(org.netbeans.modules.xslt.model.SequenceElement)
087: */
088: public void appendSequenceChild(SequenceElement element) {
089: appendChild(SEQUENCE_ELEMENT, element);
090: }
091:
092: /* (non-Javadoc)
093: * @see org.netbeans.modules.xslt.model.SequenceConstructor#getSequenceChildren()
094: */
095: public List<SequenceElement> getSequenceChildren() {
096: return getChildren(SequenceElement.class);
097: }
098:
099: /* (non-Javadoc)
100: * @see org.netbeans.modules.xslt.model.SequenceConstructor#removeSequenceChild(org.netbeans.modules.xslt.model.SequenceElement)
101: */
102: public void removeSequenceChild(SequenceElement element) {
103: removeChild(SEQUENCE_ELEMENT, element);
104: }
105:
106: /* (non-Javadoc)
107: * @see org.netbeans.modules.xslt.model.InheritNamespacesSpec#getInheritNamespaces()
108: */
109: public TBoolean getInheritNamespaces() {
110: return TBoolean
111: .forString(getAttribute(XslAttributes.INHERIT_NAMESPACES));
112: }
113:
114: /* (non-Javadoc)
115: * @see org.netbeans.modules.xslt.model.InheritNamespacesSpec#setInheritNamespaces(org.netbeans.modules.xslt.model.enums.TBoolean)
116: */
117: public void setInheritNamespaces(TBoolean value) {
118: setAttribute(XslAttributes.INHERIT_NAMESPACES, value);
119: }
120:
121: }
|