1 17 package org.alfresco.config; 18 19 import java.util.ArrayList ; 20 import java.util.List ; 21 22 27 public class ConfigSectionImpl implements ConfigSection 28 { 29 private String evaluator; 30 private String condition; 31 private boolean replace = false; 32 private List <ConfigElement> configElements; 33 34 public ConfigSectionImpl(String evaluator, String condition, boolean replace) 35 { 36 this.evaluator = evaluator; 37 this.condition = condition; 38 this.replace = replace; 39 this.configElements = new ArrayList <ConfigElement>(); 40 } 41 42 45 public String getEvaluator() 46 { 47 return this.evaluator; 48 } 49 50 53 public String getCondition() 54 { 55 return this.condition; 56 } 57 58 61 public List <ConfigElement> getConfigElements() 62 { 63 return this.configElements; 64 } 65 66 71 public void addConfigElement(ConfigElement configElement) 72 { 73 this.configElements.add(configElement); 74 } 75 76 79 public boolean isGlobal() 80 { 81 boolean global = false; 82 83 if (this.evaluator == null 84 || this.evaluator.length() == 0 85 || this.condition == null 86 || this.condition.length() == 0) 87 { 88 global = true; 89 } 90 91 return global; 92 } 93 94 97 public boolean isReplace() 98 { 99 return this.replace; 100 } 101 102 public String toString() 103 { 104 StringBuilder buffer = new StringBuilder (super.toString()); 105 buffer.append(" (evaluator=").append(this.evaluator); 106 buffer.append(" condition=").append(this.condition); 107 buffer.append(" replace=").append(this.replace).append(")"); 108 return buffer.toString(); 109 } 110 } 111 | Popular Tags |