1 package org.objectweb.kilim.description; 2 3 import org.objectweb.kilim.KilimException; 4 5 13 public abstract class TpAccessor extends InlinedElement { 14 protected BasicElement support; 15 protected String fieldName; 16 protected boolean isStatic; 17 18 28 protected TpAccessor(BasicElement aSupport, String aField, boolean jStatic, boolean isP, boolean isT, TemplateDescription aTemplate) throws KilimException { 29 super(isP, isT, aTemplate); 30 support = aSupport; 31 fieldName = aField; 32 isStatic = jStatic; 33 } 34 35 39 public boolean isStatic() { 40 return isStatic; 41 } 42 43 46 public void isStatic(boolean jStatic) { 47 isStatic = jStatic; 48 } 49 50 53 public BasicElement getSupport() { 54 return support; 55 } 56 57 62 public void setSupport(BasicElement aElement) throws KilimException { 63 if (aElement == null) { 64 throw new KilimException("attempt to set a null support to a field transformer in template " + getContainingTemplate().getName()); 65 } 66 67 if (!aElement.providesValue()) { 68 throw new KilimException("attempt use a non provider to set the support of an accessor in template " + getContainingTemplate().getName()); 69 } 70 support = aElement; 71 } 72 73 77 public String getFieldName() { 78 return fieldName; 79 } 80 81 86 public void setFieldName(String aFieldName) throws KilimException { 87 if (fieldName == null) { 88 throw new KilimException("attempt to set a null name to a field of a transformer in template " + getContainingTemplate().getName()); 89 } 90 fieldName = aFieldName; 91 } 92 } | Popular Tags |