001: // .//GEN-BEGIN:1_be
002: /******************************************************
003: * Code Generated From JAFFA Framework Default Pattern
004: *
005: * The JAFFA Project can be found at http://jaffa.sourceforge.net
006: * and is available under the Lesser GNU Public License
007: ******************************************************/package org.jaffa.rules.examples.domain;
008:
009: import org.jaffa.metadata.*;
010: import java.util.*;
011:
012: // .//GEN-END:1_be
013: // Add additional imports//GEN-FIRST:imports
014:
015: // .//GEN-LAST:imports
016: // .//GEN-BEGIN:2_be
017: /** This class has the meta information for the ValidFieldValue persistent class.
018: */
019: public class ValidFieldValueMeta {
020:
021: // domain-object class name
022: private static String m_name = "org.jaffa.rules.examples.domain.ValidFieldValue";
023:
024: // token to be used for getting the label for the domain-object
025: private static String m_labelToken = "[label.Jaffa.Admin.ValidFieldValue]";
026:
027: // Field constants
028: /** A constant to identity the TableName field.*/
029: public static final String TABLE_NAME = "TableName";
030: /** A constant to identity the FieldName field.*/
031: public static final String FIELD_NAME = "FieldName";
032: /** A constant to identity the LegalValue field.*/
033: public static final String LEGAL_VALUE = "LegalValue";
034: /** A constant to identity the Description field.*/
035: public static final String DESCRIPTION = "Description";
036: /** A constant to identity the Remarks field.*/
037: public static final String REMARKS = "Remarks";
038:
039: // Meta Data Definitions
040:
041: /** A constant which holds the meta information for the TableName field.*/
042: public static final FieldMetaData META_TABLE_NAME = new StringFieldMetaData(
043: TABLE_NAME,
044: "[label.Jaffa.Admin.ValidFieldValue.TableName]",
045: Boolean.TRUE, null, new Integer(20),
046: FieldMetaData.UPPER_CASE);
047:
048: /** A constant which holds the meta information for the FieldName field.*/
049: public static final FieldMetaData META_FIELD_NAME = new StringFieldMetaData(
050: FIELD_NAME,
051: "[label.Jaffa.Admin.ValidFieldValue.FieldName]",
052: Boolean.TRUE, null, new Integer(30),
053: FieldMetaData.UPPER_CASE);
054:
055: /** A constant which holds the meta information for the LegalValue field.*/
056: public static final FieldMetaData META_LEGAL_VALUE = new StringFieldMetaData(
057: LEGAL_VALUE,
058: "[label.Jaffa.Admin.ValidFieldValue.LegalValue]",
059: Boolean.TRUE, null, new Integer(20),
060: FieldMetaData.UPPER_CASE);
061:
062: /** A constant which holds the meta information for the Description field.*/
063: public static final FieldMetaData META_DESCRIPTION = new StringFieldMetaData(
064: DESCRIPTION,
065: "[label.Jaffa.Admin.ValidFieldValue.Description]",
066: Boolean.FALSE, null, new Integer(40),
067: FieldMetaData.UPPER_CASE);
068:
069: /** A constant which holds the meta information for the Remarks field.*/
070: public static final FieldMetaData META_REMARKS = new StringFieldMetaData(
071: REMARKS, "[label.Jaffa.Admin.ValidFieldValue.Remarks]",
072: Boolean.FALSE, null, new Integer(250),
073: FieldMetaData.MIXED_CASE);
074:
075: // Map of FieldConstants + MetaDataDefinitions
076: private static Map m_fieldMap = new HashMap();
077: static {
078: m_fieldMap.put(TABLE_NAME, META_TABLE_NAME);
079: m_fieldMap.put(FIELD_NAME, META_FIELD_NAME);
080: m_fieldMap.put(LEGAL_VALUE, META_LEGAL_VALUE);
081: m_fieldMap.put(DESCRIPTION, META_DESCRIPTION);
082: m_fieldMap.put(REMARKS, META_REMARKS);
083: }
084:
085: // List of MetaDataDefinitions for key fields
086: private static List m_keyFields = new LinkedList();
087: static {
088: m_keyFields.add(META_TABLE_NAME);
089: m_keyFields.add(META_FIELD_NAME);
090: m_keyFields.add(META_LEGAL_VALUE);
091: }
092:
093: // List of MetaDataDefinitions for mandatory fields
094: private static List m_mandatoryFields = new LinkedList();
095: static {
096: m_mandatoryFields.add(META_TABLE_NAME);
097: m_mandatoryFields.add(META_FIELD_NAME);
098: m_mandatoryFields.add(META_LEGAL_VALUE);
099: }
100:
101: /** Returns the name of the persistent class.
102: * @return the name of the persistent class.
103: */
104: public static String getName() {
105: return m_name;
106: }
107:
108: /** Getter for property labelToken.
109: * @return Value of property labelToken.
110: */
111: public static String getLabelToken() {
112: return m_labelToken;
113: }
114:
115: /** This returns an array of all the fields of the persistent class.
116: * @return an array of all the fields of the persistent class.
117: */
118: public static String[] getAttributes() {
119: return DomainMetaDataHelper.getAttributes(m_fieldMap);
120: }
121:
122: /** This returns an array of meta information for all the fields of the persistent class.
123: * @return an array of meta information for all the fields of the persistent class.
124: */
125: public static FieldMetaData[] getFieldMetaData() {
126: return DomainMetaDataHelper.getFieldMetaData(m_fieldMap);
127: }
128:
129: /** This returns meta information for the input field.
130: * @param fieldName the field name.
131: * @return meta information for the input field.
132: */
133: public static FieldMetaData getFieldMetaData(String fieldName) {
134: return DomainMetaDataHelper.getFieldMetaData(m_fieldMap,
135: fieldName);
136: }
137:
138: /** This returns an array of meta information for all the key fields of the persistent class.
139: * @return an array of meta information for all the key fields of the persistent class.
140: */
141: public static FieldMetaData[] getKeyFields() {
142: return (FieldMetaData[]) m_keyFields
143: .toArray(new FieldMetaData[0]);
144: }
145:
146: /** This returns an array of meta information for all the mandatory fields of the persistent class.
147: * @return an array of meta information for all the mandatory fields of the persistent class.
148: */
149: public static FieldMetaData[] getMandatoryFields() {
150: return (FieldMetaData[]) m_mandatoryFields
151: .toArray(new FieldMetaData[0]);
152: }
153:
154: // .//GEN-END:2_be
155: // All the custom code goes here//GEN-FIRST:custom
156:
157: // .//GEN-LAST:custom
158: }
|