001: /*
002: Copyright (c) 2006, Dennis M. Sosnoski
003: All rights reserved.
004:
005: Redistribution and use in source and binary forms, with or without modification,
006: are permitted provided that the following conditions are met:
007:
008: * Redistributions of source code must retain the above copyright notice, this
009: list of conditions and the following disclaimer.
010: * Redistributions in binary form must reproduce the above copyright notice,
011: this list of conditions and the following disclaimer in the documentation
012: and/or other materials provided with the distribution.
013: * Neither the name of JiBX nor the names of its contributors may be used
014: to endorse or promote products derived from this software without specific
015: prior written permission.
016:
017: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
018: ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
019: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
020: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
021: ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
022: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
023: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
024: ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
026: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027: */
028:
029: package org.jibx.typeinfo;
030:
031: /**
032: * Simple holder for field information.
033: *
034: * @author Dennis M. Sosnoski
035: */
036: public class FieldDescription {
037: /** Field name. */
038: private final String m_name;
039:
040: /** Access flags. */
041: private int m_accessFlags;
042:
043: /** Type description. */
044: private TypeDescription m_type;
045:
046: /** Field documentation text. */
047: private String m_javaDoc;
048:
049: /** Type signature. */
050: private String m_signature;
051:
052: /**
053: * Constructor with all values.
054: *
055: * @param name
056: * @param access access flags
057: * @param type actual type description (<code>null</code> if unspecified)
058: * @param sig type signature (<code>null</code> if none)
059: * @param doc documentation string (<code>null</code> if none)
060: */
061: public FieldDescription(String name, int access,
062: TypeDescription type, String sig, String doc) {
063: m_name = name;
064: m_accessFlags = access;
065: m_type = type;
066: m_javaDoc = doc;
067: m_signature = sig;
068: }
069:
070: /**
071: * Constructor with only basic information.
072: *
073: * @param name
074: * @param access access flags
075: * @param type actual type description (<code>null</code> if none)
076: */
077: public FieldDescription(String name, int access,
078: TypeDescription type) {
079: this (name, access, type, null, null);
080: }
081:
082: /**
083: * Get field name.
084: *
085: * @return name
086: */
087: public String getName() {
088: return m_name;
089: }
090:
091: /**
092: * Get access flags.
093: *
094: * @return flags
095: */
096: public int getAccessFlags() {
097: return m_accessFlags;
098: }
099:
100: /**
101: * Set access flags.
102: *
103: * @param flags
104: */
105: public void setAccessFlags(int flags) {
106: m_accessFlags = flags;
107: }
108:
109: /**
110: * Get type description.
111: *
112: * @return type (<code>null</code> if unspecified)
113: */
114: public TypeDescription getType() {
115: return m_type;
116: }
117:
118: /**
119: * Set type.
120: *
121: * @param type (<code>null</code> if unspecified)
122: */
123: public void setType(TypeDescription type) {
124: m_type = type;
125: }
126:
127: /**
128: * Get documentation text.
129: *
130: * @return doc (<code>null</code> if none)
131: */
132: public String getJavaDoc() {
133: return m_javaDoc;
134: }
135:
136: /**
137: * Set documentation text.
138: *
139: * @param doc (<code>null</code> if none)
140: */
141: public void setJavaDoc(String doc) {
142: m_javaDoc = doc;
143: }
144:
145: /**
146: * Get field type signature.
147: *
148: * @return signature
149: */
150: public String getSignature() {
151: return m_signature;
152: }
153:
154: /**
155: * Set field type signature.
156: *
157: * @param sig
158: */
159: public void setSignature(String sig) {
160: m_signature = sig;
161: }
162: }
|