public AttributeDescr getAttribute( String name ) { if ( name != null ) { for ( AttributeDescr attr : this.attributes ) { if ( name.equals( attr.getName() ) ) { return attr; } } } return null; }
public void addAttribute(final AttributeDescr attribute) { if ( attribute != null ) { this.attributes.put( attribute.getName(), attribute ); } }
public void visitAttributeDescr(final AttributeDescr attributeDescr) { this.template = new String(); this.template = "<rule-attribute name=\"" + attributeDescr.getName() + "\" value=\"" + attributeDescr.getValue() + "\" />" + XmlDumper.eol; }
public void addRule( final RuleDescr rule ) { if ( this.rules == Collections.EMPTY_LIST ) { this.rules = new ArrayList<RuleDescr>( 1 ); } for ( final AttributeDescr at : attributes ) { // check if rule overrides the attribute if ( !rule.getAttributes().containsKey( at.getName() ) ) { // if not, use default value rule.addAttribute( at ); } } this.rules.add( rule ); }
private void inheritPackageAttributes( Map<String, AttributeDescr> pkgAttributes, RuleDescr ruleDescr ) { if (pkgAttributes == null) { return; } for (AttributeDescr attrDescr : pkgAttributes.values()) { String name = attrDescr.getName(); AttributeDescr ruleAttrDescr = ruleDescr.getAttributes().get( name ); if (ruleAttrDescr == null) { ruleDescr.getAttributes().put( name, attrDescr ); } } }
private String getPackageDialect(PackageDescr packageDescr) { String dialectName = this.defaultDialect; // see if this packageDescr overrides the current default dialect for (AttributeDescr value : packageDescr.getAttributes()) { if ("dialect".equals(value.getName())) { dialectName = value.getValue(); break; } } return dialectName; }
pkgAttributes.put( attr.getName(), attr );
final String name = attributeDescr.getName(); if ( name.equals( "no-loop" ) ) { rule.setNoLoop( getBooleanValue( attributeDescr,