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.Element;
025: import org.netbeans.modules.xslt.model.XslComponent;
026: import org.netbeans.modules.xslt.model.XslReference;
027: import org.netbeans.modules.xslt.model.XslVisitor;
028: import org.netbeans.modules.xslt.model.enums.TBoolean;
029: import org.netbeans.modules.xslt.model.enums.Validation;
030:
031: /**
032: * @author ads
033: *
034: */
035: class ElementImpl extends TypeableNameableSeqElCtor implements Element {
036:
037: ElementImpl(XslModelImpl model, org.w3c.dom.Element element) {
038: super (model, element);
039: }
040:
041: ElementImpl(XslModelImpl model) {
042: super (model, XslElements.ELEMENT);
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 Element.class;
059: }
060:
061: /* (non-Javadoc)
062: * @see org.netbeans.modules.xslt.model.ValidationSpec#getValidation()
063: */
064: public Validation getValidation() {
065: return Validation
066: .forString(getAttribute(XslAttributes.VALIDATION));
067: }
068:
069: /* (non-Javadoc)
070: * @see org.netbeans.modules.xslt.model.ValidationSpec#setValidation(org.netbeans.modules.xslt.model.enums.Validation)
071: */
072: public void setValidation(Validation validation) {
073: setAttribute(XslAttributes.VALIDATION, validation);
074: }
075:
076: /* (non-Javadoc)
077: * @see org.netbeans.modules.xslt.model.UseAttributesSetsSpec#getUseAttributeSets()
078: */
079: public List<XslReference<AttributeSet>> getUseAttributeSets() {
080: return resolveGlobalReferenceList(AttributeSet.class,
081: XslAttributes.USE_ATTRIBUTE_SETS);
082: }
083:
084: /* (non-Javadoc)
085: * @see org.netbeans.modules.xslt.model.UseAttributesSetsSpec#setUseAttributeSets(java.util.Collection)
086: */
087: public void setUseAttributeSets(
088: List<XslReference<AttributeSet>> collection) {
089: setAttributeList(XslAttributes.USE_ATTRIBUTE_SETS, collection);
090: }
091:
092: /* (non-Javadoc)
093: * @see org.netbeans.modules.xslt.model.InheritNamespacesSpec#getInheritNamespaces()
094: */
095: public TBoolean getInheritNamespaces() {
096: return TBoolean
097: .forString(getAttribute(XslAttributes.INHERIT_NAMESPACES));
098: }
099:
100: /* (non-Javadoc)
101: * @see org.netbeans.modules.xslt.model.InheritNamespacesSpec#setInheritNamespaces(org.netbeans.modules.xslt.model.enums.TBoolean)
102: */
103: public void setInheritNamespaces(TBoolean value) {
104: setAttribute(XslAttributes.INHERIT_NAMESPACES, value);
105: }
106:
107: }
|