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 javax.xml.namespace.QName;
024:
025: import org.netbeans.modules.xslt.model.ApplyTemplateChild;
026: import org.netbeans.modules.xslt.model.ApplyTemplates;
027: import org.netbeans.modules.xslt.model.XslComponent;
028: import org.netbeans.modules.xslt.model.XslVisitor;
029: import org.w3c.dom.Element;
030:
031: /**
032: * @author ads
033: *
034: */
035: class ApplyTemplatesImpl extends SequenceElementImpl implements
036: ApplyTemplates {
037:
038: ApplyTemplatesImpl(XslModelImpl model, Element element) {
039: super (model, element);
040: }
041:
042: ApplyTemplatesImpl(XslModelImpl model) {
043: super (model, XslElements.APPLY_TEMPLATES);
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 ApplyTemplates.class;
060: }
061:
062: /* (non-Javadoc)
063: * @see org.netbeans.modules.xslt.model.ApplyTemplates#addChildElement(org.netbeans.modules.xslt.model.ApplyTemplateChild, int)
064: */
065: public void addChildElement(ApplyTemplateChild child, int position) {
066: insertAtIndex(CHILD_ELEMENTS, child, position);
067: }
068:
069: /* (non-Javadoc)
070: * @see org.netbeans.modules.xslt.model.ApplyTemplates#appendChildElement(org.netbeans.modules.xslt.model.ApplyTemplateChild)
071: */
072: public void appendChildElement(ApplyTemplateChild child) {
073: appendChild(CHILD_ELEMENTS, child);
074: }
075:
076: /* (non-Javadoc)
077: * @see org.netbeans.modules.xslt.model.ApplyTemplates#getChildrenElements()
078: */
079: public List<ApplyTemplateChild> getChildrenElements() {
080: return getChildren(ApplyTemplateChild.class);
081: }
082:
083: /* (non-Javadoc)
084: * @see org.netbeans.modules.xslt.model.ApplyTemplates#removeChildElement(org.netbeans.modules.xslt.model.ApplyTemplateChild)
085: */
086: public void removeChildElement(ApplyTemplateChild child) {
087: removeChild(CHILD_ELEMENTS, child);
088: }
089:
090: /* (non-Javadoc)
091: * @see org.netbeans.modules.xslt.model.ModeSpec#getMode()
092: */
093: public QName getMode() {
094: return QNameBuilder.createQName(this , XslAttributes.MODE);
095: }
096:
097: /* (non-Javadoc)
098: * @see org.netbeans.modules.xslt.model.ModeSpec#setMode(java.lang.String)
099: */
100: public void setMode(QName mode) {
101: setAttribute(XslAttributes.MODE, mode);
102: }
103:
104: }
|