1 56 57 package org.objectstyle.cayenne.dataview.dvmodeler; 58 59 import org.jdom.*; 60 61 66 67 public class DisplayFormat{ 68 private String className = ""; 69 private String pattern = ""; 70 71 public DisplayFormat(Element element){ 72 className = element.getAttributeValue("class"); 73 pattern = element.getChild("pattern").getText(); 74 } 75 public DisplayFormat(){ 76 } 77 78 public boolean isEmpty(){ 79 if (className.length() == 0){ 80 return true; 81 } else{ 82 return false; 83 } 84 } 85 86 public void setClassName(String className){ 87 this.className = className; 88 } 89 90 public String getClassName(){ 91 return className; 92 } 93 94 public void setPattern(String Pattern){ 95 this.pattern = Pattern; 96 } 97 98 public String getPattern(){ 99 return pattern; 100 } 101 102 public Element getDisplayFormatElement(){ 103 Element e = new Element("display-format"); 104 e.setAttribute(new Attribute("class", className)); 105 Element ePattern = new Element("pattern"); 106 ePattern.addContent(pattern); 107 e.addContent(ePattern); 108 return e; 109 } 110 } 111 | Popular Tags |