1 12 package org.openbravo.xmlEngine; 13 14 import java.util.Vector ; 15 import java.text.DecimalFormat ; 16 17 import org.apache.log4j.Logger ; 18 19 class FieldTemplate implements XmlComponentTemplate, IDComponent { 20 private String fieldName; 21 int type = FIELD; 22 DecimalFormat formatOutput; 23 DecimalFormat formatSimple; 24 Vector vecReplace; 25 26 static Logger log4jFieldTemplate = Logger.getLogger(FieldTemplate.class); 27 28 public FieldTemplate(String fieldName, DecimalFormat formatOutput, DecimalFormat formatSimple, 29 Vector vecReplace) { this.fieldName = fieldName; 31 this.formatOutput = formatOutput; 32 this.formatSimple = formatSimple; 33 this.vecReplace = vecReplace; 34 } 35 36 public int type() { 37 return type; 38 } 39 40 public String name() { 41 return fieldName; 42 } 43 44 61 public FieldValue createFieldValue(XmlDocument xmlDocument) { 63 FieldValue fieldValue = (FieldValue)xmlDocument.hasXmlComponentValue.get(this); 64 if (fieldValue == null) { 65 fieldValue = new FieldValue(this, xmlDocument); 66 xmlDocument.hasXmlComponentValue.put(this, fieldValue); 67 } 68 return fieldValue; 69 } 70 71 public XmlComponentValue createXmlComponentValue(XmlDocument xmlDocument) { 72 return createFieldValue(xmlDocument); 73 } 74 } 75 | Popular Tags |