Source Code Cross Referenced for JField.java in  » Testing » Ejb3Unit » com » bm » ejb3metadata » annotations » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » Ejb3Unit » com.bm.ejb3metadata.annotations 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * EasyBeans
003:         * Copyright (C) 2006 Bull S.A.S.
004:         * Contact: easybeans@objectweb.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * --------------------------------------------------------------------------
022:         * $Id: JField.java 47 2006-02-28 10:42:29Z benoitf $
023:         * --------------------------------------------------------------------------
024:         */package com.bm.ejb3metadata.annotations;
025:
026:        /**
027:         * This class defines a Field object. It is not based on reflection.
028:         * @author Florent Benoit
029:         */
030:        public class JField {
031:
032:            /**
033:             * Name of the field.
034:             */
035:            private String name = null;
036:
037:            /**
038:             * Access mode (see {@link org.ejb3unit.asm.Opcodes}).
039:             */
040:            private int access;
041:
042:            /**
043:             * Field's descriptor.
044:             */
045:            private String descriptor = null;
046:
047:            /**
048:             * Field's signature.
049:             */
050:            private String signature;
051:
052:            /**
053:             * Value of the field.
054:             */
055:            private Object value;
056:
057:            /**
058:             * Constructor. *
059:             * @param access the field's access flags (see
060:             *        {@link org.ejb3unit.asm.Opcodes}). This parameter also indicates
061:             *        if the field is synthetic and/or deprecated.
062:             * @param name the field's name.
063:             * @param descriptor the field's descriptor (see
064:             *        {@link org.ejb3unit.asm.Type}).
065:             * @param signature the field's signature. May be <tt>null</tt> if the
066:             *        field's type does not use generic types.
067:             * @param value the field's initial value. This parameter, which may be
068:             *        <tt>null</tt> if the field does not have an initial value, must
069:             *        be an {@link Integer}, a {@link Float}, a {@link Long}, a
070:             *        {@link Double} or a {@link String} (for <tt>int</tt>,
071:             *        <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
072:             *        respectively). <i>This parameter is only used for static fields</i>.
073:             *        Its value is ignored for non static fields, which must be
074:             *        initialized through bytecode instructions in constructors or
075:             *        methods.
076:             */
077:            public JField(final int access, final String name,
078:                    final String descriptor, final String signature,
079:                    final Object value) {
080:                this .access = access;
081:                this .name = name;
082:                this .descriptor = descriptor;
083:                this .signature = signature;
084:                this .value = value;
085:            }
086:
087:            /**
088:             * Indicates whether some other object is "equal to" this one.
089:             * @param obj object to compare
090:             * @return true if given object is equals
091:             */
092:            @Override
093:            public boolean equals(final Object obj) {
094:                if (obj != null && obj instanceof  JField) {
095:                    JField other = (JField) obj;
096:
097:                    // same name
098:                    if (!this .name.equals(other.name)) {
099:                        return false;
100:                    }
101:
102:                    // same descriptor
103:                    if ((this .descriptor != null)
104:                            && (!this .descriptor.equals(other.descriptor))) {
105:                        return false;
106:                    }
107:
108:                    // same signature
109:                    if ((this .signature != null)
110:                            && (!this .signature.equals(other.signature))) {
111:                        return false;
112:                    }
113:
114:                    // if all tests succeed, return true
115:                    return true;
116:                }
117:                return false;
118:            }
119:
120:            /**
121:             * a hash code value for the object.
122:             * @return a hash code value for the object.
123:             */
124:            @Override
125:            public int hashCode() {
126:                return name.hashCode();
127:            }
128:
129:            /**
130:             * field's descriptor.
131:             * @return field's descriptor.
132:             */
133:            public String getDescriptor() {
134:                return descriptor;
135:            }
136:
137:            /**
138:             * field's value.
139:             * @return field's value.
140:             */
141:            public Object getValue() {
142:                return value;
143:            }
144:
145:            /**
146:             * method name.
147:             * @return method name
148:             */
149:            public String getName() {
150:                return name;
151:            }
152:
153:            /**
154:             * method signature.
155:             * @return method signature
156:             */
157:            public String getSignature() {
158:                return signature;
159:            }
160:
161:            /**
162:             * {@inheritDoc}
163:             */
164:            @Override
165:            public String toString() {
166:                StringBuilder sb = new StringBuilder();
167:                // classname
168:                sb.append(this .getClass().getName().substring(
169:                        this .getClass().getPackage().getName().length() + 1));
170:
171:                // name
172:                sb.append("[name=");
173:                sb.append(name);
174:
175:                // access
176:                sb.append(", access=");
177:                sb.append(access);
178:
179:                // descriptor
180:                if (descriptor != null) {
181:                    sb.append(", descriptor=");
182:                    sb.append(descriptor);
183:                }
184:
185:                // signature
186:                if (signature != null) {
187:                    sb.append(", signature=");
188:                    sb.append(signature);
189:                }
190:
191:                // exceptions
192:                if (value != null) {
193:                    sb.append(", value=");
194:                    sb.append(value);
195:                }
196:                sb.append("]");
197:                return sb.toString();
198:            }
199:
200:            /**
201:             * the field's access flags.
202:             * @return the field's access flags
203:             */
204:            public int getAccess() {
205:                return access;
206:            }
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.