1 /***
2 * Copyright (c) 2002, CodeStreet LLC. All rights reserved.<p>
3 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
4 * conditions are met:<p>
5 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
7 * in the documentation and/or other materials provided with the distribution. Neither the name of CodeStreet LLC. nor the
8 * names of its contributors may be used to endorse or promote products derived from this software without specific prior written
9 * permission.<p>
10 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
11 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
12 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
13 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
14 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<p>
16 */
17
18 package com.codestreet.messageforge;
19
20 /***
21 * Interface implemented by <tt>RFld</tt> and subclasses.
22 * @author Jawaid Hakim.
23 */
24 public interface RFldInterface extends java.io.Serializable
25 {
26 /***
27 * Get field name.
28 * @return Field name.
29 */
30 String getName();
31
32 /***
33 * Get field id.
34 * @return Field id.
35 */
36 int getId();
37
38 /***
39 * Get message description.
40 * @return Message description.
41 */
42 String getDesc();
43
44 /***
45 * Get field type.
46 * @return Field type.
47 * @see RFldType
48 */
49 RFldType getType();
50
51 /***
52 * Check if field value has been set.
53 * @return <tt>true if field value has been set. Othewrwise,
54 * return <tt>false</tt>.
55 */
56 boolean isValSet();
57
58 /***
59 * Check if field value has constrained.
60 * @return <tt>true if field value has constrained. Othewrwise,
61 * return <tt>false</tt>.
62 */
63 boolean isConstrained();
64
65
66 /***
67 * Check if field is locked.
68 * @return <tt>true if field value is locked. Othewrwise,
69 * return <tt>false</tt>.
70 */
71 boolean isLocked();
72
73
74 /***
75 * Check if this field is a property.
76 *
77 * @return Returns <code>true</code> if this field is a property.
78 * @see #getPropertyName()
79 */
80 boolean isProperty();
81
82 /***
83 * Get property name.
84 *
85 * @return Returns property name if this field is a property. Returns
86 * <code>null</code> if this field is not a property.
87 * @see #isProperty()
88 */
89 String getPropertyName();
90
91 /***
92 * Set state from an Object.
93 * @param fld Source object.
94 * @return Reference to self so method chaining can be used.
95 */
96 RFld set(Object fld) throws FieldValidationException;
97
98 /***
99 * Set data from JDOM element.
100 * @param newData New data.
101 * @return Reference to self so method chaining can be used.
102 */
103 RFld set(org.jdom.Element newData) throws FieldValidationException;
104
105 /***
106 * Get the field value as an object.
107 * @return Field value as an object. Returns <tt>null</tt> if the field
108 * value is not set.
109 */
110 Object getValueAsObject();
111
112 /***
113 * Get the field value as a java.util.Hashtable. Every field type that is not directly
114 * supported within Tibrv - every field with type greater than or equal to
115 * RFldType.USER_FIRST - and including fields of type TibrvMsg will implement
116 * this method.
117 * @return Field value as java.util.Hashtable.
118 */
119 java.util.Hashtable getValueAsHashtable() throws FieldValidationException;
120
121 /***
122 * Marshall the field as XML to target writer.
123 * @param writer Output target.
124 * @param indent Indentation.
125 * @param newLines Newlines are inserted after each element if <tt>true</tt>.
126 * @param expandEmptyElem Empty elements - elements with no content - are expanded if <tt>true</tt>.
127 */
128 void marshal(java.io.Writer writer, int indentLevel, String indent, boolean newLines, boolean expandEmptyElem) throws ConverterException;
129 }
This page was automatically generated by Maven