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.CallTemplate;
024: import org.netbeans.modules.xslt.model.Template;
025: import org.netbeans.modules.xslt.model.WithParam;
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.w3c.dom.Element;
030:
031: /**
032: * @author ads
033: *
034: */
035: class CallTemplateImpl extends XslComponentImpl implements CallTemplate {
036:
037: CallTemplateImpl(XslModelImpl model, Element element) {
038: super (model, element);
039: }
040:
041: CallTemplateImpl(XslModelImpl model) {
042: super (model, XslElements.CALL_TEMPLATE);
043: }
044:
045: /* (non-Javadoc)
046: * @see org.netbeans.modules.xslt.model.impl.XslComponentImpl#accept(org.netbeans.modules.xslt.model.XslVisitor)
047: */
048: @Override
049: public void accept(XslVisitor visitor) {
050: visitor.visit(this );
051: }
052:
053: /* (non-Javadoc)
054: * @see org.netbeans.modules.xslt.model.impl.XslComponentImpl#getComponentType()
055: */
056: @Override
057: public Class<? extends XslComponent> getComponentType() {
058: return CallTemplate.class;
059: }
060:
061: /* (non-Javadoc)
062: * @see org.netbeans.modules.xslt.model.WithParamContainer#addWithParam(org.netbeans.modules.xslt.model.WithParam, int)
063: */
064: public void addWithParam(WithParam withParam, int position) {
065: insertAtIndex(WITH_PARAM, withParam, position);
066: }
067:
068: /* (non-Javadoc)
069: * @see org.netbeans.modules.xslt.model.WithParamContainer#appendWithParam(org.netbeans.modules.xslt.model.WithParam)
070: */
071: public void appendWithParam(WithParam withParam) {
072: appendChild(WITH_PARAM, withParam);
073: }
074:
075: /* (non-Javadoc)
076: * @see org.netbeans.modules.xslt.model.WithParamContainer#getWithParams()
077: */
078: public List<WithParam> getWithParams() {
079: return getChildren(WithParam.class);
080: }
081:
082: /* (non-Javadoc)
083: * @see org.netbeans.modules.xslt.model.WithParamContainer#removeWithParam(org.netbeans.modules.xslt.model.WithParam)
084: */
085: public void removeWithParam(WithParam withParam) {
086: removeChild(WITH_PARAM, withParam);
087: }
088:
089: /* (non-Javadoc)
090: * @see org.netbeans.modules.xslt.model.CallTemplate#getName()
091: */
092: public XslReference<Template> getName() {
093: return resolveGlobalReference(Template.class,
094: XslAttributes.NAME_OF_CALL_TMPL);
095: }
096:
097: /* (non-Javadoc)
098: * @see org.netbeans.modules.xslt.model.CallTemplate#setName(org.netbeans.modules.xml.xam.Reference)
099: */
100: public void setName(XslReference<Template> name) {
101: setAttribute(XslAttributes.NAME_OF_CALL_TMPL, name);
102: }
103:
104: }
|