Changeset 126 for Xml/xsd-fu/trunk/templates/Class.template
- Timestamp:
- 11/21/07 15:30:43 (14 months ago)
- Files:
-
- 1 modified
-
Xml/xsd-fu/trunk/templates/Class.template (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Xml/xsd-fu/trunk/templates/Class.template
r111 r126 39 39 package ${fu.package}; 40 40 41 import ome.xml.DOMUtil; 42 import ome.xml.OMEXMLNode; 43 41 44 import java.util.Vector; 45 import java.util.List; 46 42 47 import org.w3c.dom.Element; 43 48 44 49 public class ${klass.name}Node extends ${klass.javaBase} 45 50 { 46 // -- Constructor --51 // -- Constructors -- 47 52 53 /** Constructs a ${klass.name} node with an associated DOM element. */ 48 54 public ${klass.name}Node(Element element) 49 55 { 50 56 super(element); 51 57 } 52 58 59 /** 60 * Constructs a ${klass.name} node with an associated DOM element beneath 61 * a given parent. 62 */ 63 public ${klass.name}Node(OMEXMLNode parent) 64 { 65 this(parent, true); 66 } 67 68 /** 69 * Constructs a ${klass.name} node with an associated DOM element beneath 70 * a given parent. 71 */ 72 public ${klass.name}Node(OMEXMLNode parent, boolean attach) 73 { 74 super(DOMUtil.createChild(parent.getDOMElement(), 75 "${klass.name}", attach)); 76 } 77 53 78 // -- ${klass.name} API methods -- 54 79 {% for prop in klass.properties.values() %}\ 55 80 {% choose %}\ 56 {% when prop.isAttribute and prop.type[-2:] == "ID" and prop.name not in fu.DO_NOT_PROCESS %} 81 {% when prop.isReference %} 82 // Virtual, inferred back reference ${prop.name} 83 public List get${prop.javaType}List() 84 { 85 return getReferringNodes("${prop.javaType}"); 86 } 87 88 public int count${prop.javaType}List() 89 { 90 return getReferringCount("${prop.javaType}"); 91 } 92 {% end %}\ 93 {% when prop.isAttribute and prop.type[-2:] == "ID" and \ 94 prop.name not in fu.DO_NOT_PROCESS %} 57 95 // Attribute which is an OME XML "ID" 58 96 public ${prop.javaType} get${prop.name}() … … 141 179 } 142 180 } 181
