1 19 package org.netbeans.modules.xslt.model.impl; 20 21 import java.util.List ; 22 23 import javax.xml.namespace.QName ; 24 25 import org.netbeans.modules.xslt.model.Param; 26 import org.netbeans.modules.xslt.model.Template; 27 import org.netbeans.modules.xslt.model.XslComponent; 28 import org.netbeans.modules.xslt.model.XslVisitor; 29 import org.w3c.dom.Element ; 30 31 32 36 class TemplateImpl extends MatchableQNameableSeqCtorImpl implements Template { 37 38 TemplateImpl( XslModelImpl model, Element element ) { 39 super( model , element ); 40 } 41 42 TemplateImpl( XslModelImpl model ) { 43 super( model , XslElements.TEMPLATE ); 44 } 45 46 49 @Override 50 public void accept( XslVisitor visitor ) 51 { 52 visitor.visit( this ); 53 } 54 55 58 @Override 59 public Class <? extends XslComponent> getComponentType() 60 { 61 return Template.class; 62 } 63 64 67 public Double getPriority() { 68 String value = getAttribute( XslAttributes.PRIORITY ); 69 Double numValue = Double.parseDouble( value ); 70 return numValue; 71 } 72 73 76 public void setPriority( Double priority ) { 77 setAttribute( XslAttributes.PRIORITY, priority ); 78 } 79 80 83 public void addParam( Param param, int position ) { 84 insertAtIndex( PARAM_PROPERTY, param, position ); 85 } 86 87 90 public void appendParam( Param param ) { 91 addBefore( PARAM_PROPERTY , param , SEQUENCE_ELEMENTS ); 92 } 93 94 97 public List <Param> getParams() { 98 return getChildren( Param.class ); 99 } 100 101 104 public void removeParam( Param param ) { 105 removeChild( PARAM_PROPERTY , param ); 106 } 107 108 111 public List <QName > getMode() { 112 return getQNameList( getAttribute( XslAttributes.MODES ) ); 113 } 114 115 118 public void setMode( List <QName > mode ) { 119 setAttribute( XslAttributes.MODES, mode ); 120 } 121 122 125 public String getAs() { 126 return getAttribute( XslAttributes.AS ); 127 } 128 129 132 public void setAs( String value ) { 133 setAttribute( XslAttributes.AS, value ); 134 } 135 136 } 137 | Popular Tags |