1 16 17 package org.apache.commons.betwixt; 18 19 import org.apache.commons.betwixt.strategy.ClassNormalizer; 20 import org.apache.commons.betwixt.strategy.DefaultNameMapper; 21 import org.apache.commons.betwixt.strategy.DefaultPluralStemmer; 22 import org.apache.commons.betwixt.strategy.NameMapper; 23 import org.apache.commons.betwixt.strategy.NamespacePrefixMapper; 24 import org.apache.commons.betwixt.strategy.PluralStemmer; 25 import org.apache.commons.betwixt.strategy.SimpleTypeMapper; 26 import org.apache.commons.betwixt.strategy.StandardSimpleTypeMapper; 27 import org.apache.commons.betwixt.strategy.TypeBindingStrategy; 28 import org.apache.commons.logging.Log; 29 import org.apache.commons.logging.LogFactory; 30 31 49 public class IntrospectionConfiguration { 50 51 52 private boolean attributesForPrimitives = false; 53 54 55 private boolean wrapCollectionsInElement = true; 56 57 58 private boolean useBeanInfoSearchPath = false; 59 60 62 private PluralStemmer pluralStemmer; 63 64 65 private NameMapper elementNameMapper; 66 67 68 private ClassNormalizer classNormalizer = new ClassNormalizer(); 69 70 71 private Log introspectionLog = LogFactory.getLog(XMLIntrospector.class); 72 73 77 private NameMapper attributeNameMapper; 78 79 80 private NamespacePrefixMapper prefixMapper = new NamespacePrefixMapper(); 81 82 private SimpleTypeMapper simpleTypeMapper = new StandardSimpleTypeMapper(); 83 84 private TypeBindingStrategy typeBindingStrategy = TypeBindingStrategy.DEFAULT; 85 86 94 public ClassNormalizer getClassNormalizer() { 95 return classNormalizer; 96 } 97 98 106 public void setClassNormalizer(ClassNormalizer classNormalizer) { 107 this.classNormalizer = classNormalizer; 108 } 109 110 114 public boolean isAttributesForPrimitives() { 115 return attributesForPrimitives; 116 } 117 118 123 public void setAttributesForPrimitives(boolean attributesForPrimitives) { 124 this.attributesForPrimitives = attributesForPrimitives; 125 } 126 127 132 public boolean isWrapCollectionsInElement() { 133 return wrapCollectionsInElement; 134 } 135 136 142 public void setWrapCollectionsInElement(boolean wrapCollectionsInElement) { 143 this.wrapCollectionsInElement = wrapCollectionsInElement; 144 } 145 146 151 public PluralStemmer getPluralStemmer() { 152 if ( pluralStemmer == null ) { 153 pluralStemmer = createPluralStemmer(); 154 } 155 return pluralStemmer; 156 } 157 158 163 public void setPluralStemmer(PluralStemmer pluralStemmer) { 164 this.pluralStemmer = pluralStemmer; 165 } 166 167 173 public NameMapper getElementNameMapper() { 174 if ( elementNameMapper == null ) { 175 elementNameMapper = createNameMapper(); 176 } 177 return elementNameMapper; 178 } 179 180 184 public void setElementNameMapper(NameMapper nameMapper) { 185 this.elementNameMapper = nameMapper; 186 } 187 188 194 public NameMapper getAttributeNameMapper() { 195 if (attributeNameMapper == null) { 196 attributeNameMapper = createNameMapper(); 197 } 198 return attributeNameMapper; 199 } 200 201 202 206 public void setAttributeNameMapper(NameMapper nameMapper) { 207 this.attributeNameMapper = nameMapper; 208 } 209 210 216 public boolean useBeanInfoSearchPath() { 217 return useBeanInfoSearchPath; 218 } 219 220 225 public void setUseBeanInfoSearchPath(boolean useBeanInfoSearchPath) { 226 this.useBeanInfoSearchPath = useBeanInfoSearchPath; 227 } 228 229 235 protected PluralStemmer createPluralStemmer() { 236 return new DefaultPluralStemmer(); 237 } 238 239 245 protected NameMapper createNameMapper() { 246 return new DefaultNameMapper(); 247 } 248 249 255 public Log getIntrospectionLog() { 256 return introspectionLog; 257 } 258 259 265 public void setIntrospectionLog(Log log) { 266 introspectionLog = log; 267 } 268 269 270 275 public NamespacePrefixMapper getPrefixMapper() { 276 return prefixMapper; 277 } 278 279 284 public void setPrefixMapper(NamespacePrefixMapper mapper) { 285 prefixMapper = mapper; 286 } 287 288 289 293 public SimpleTypeMapper getSimpleTypeMapper() { 294 return simpleTypeMapper; 295 } 296 297 301 public void setSimpleTypeMapper(SimpleTypeMapper mapper) { 302 simpleTypeMapper = mapper; 303 } 304 305 311 public TypeBindingStrategy getTypeBindingStrategy() { 312 return typeBindingStrategy; 313 } 314 315 321 public void setTypeBindingStrategy(TypeBindingStrategy typeBindingStrategy) { 322 this.typeBindingStrategy = typeBindingStrategy; 323 } 324 } 325 | Popular Tags |