Source Code Cross Referenced for JField.java in  » J2EE » ow2-easybeans » org » ow2 » easybeans » deployment » 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 » J2EE » ow2 easybeans » org.ow2.easybeans.deployment.annotations 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * EasyBeans
003:         * Copyright (C) 2006 Bull S.A.S.
004:         * Contact: easybeans@ow2.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 2059 2007-11-22 17:22:33Z benoitf $
023:         * --------------------------------------------------------------------------
024:         */package org.ow2.easybeans.deployment.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.ow2.easybeans.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.ow2.easybeans.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.ow2.easybeans.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:             * @return a hash code value for the object.
122:             */
123:            @Override
124:            public int hashCode() {
125:                return name.hashCode();
126:            }
127:
128:            /**
129:             * @return field's descriptor.
130:             */
131:            public String getDescriptor() {
132:                return descriptor;
133:            }
134:
135:            /**
136:             * @return field's value.
137:             */
138:            public Object getValue() {
139:                return value;
140:            }
141:
142:            /**
143:             * @return method name
144:             */
145:            public String getName() {
146:                return name;
147:            }
148:
149:            /**
150:             * @return method signature
151:             */
152:            public String getSignature() {
153:                return signature;
154:            }
155:
156:            /**
157:             * @return string representation
158:             */
159:            @Override
160:            public String toString() {
161:                StringBuilder sb = new StringBuilder();
162:                // classname
163:                sb.append(this .getClass().getName().substring(
164:                        this .getClass().getPackage().getName().length() + 1));
165:
166:                // name
167:                sb.append("[name=");
168:                sb.append(name);
169:
170:                // access
171:                sb.append(", access=");
172:                sb.append(access);
173:
174:                // descriptor
175:                if (descriptor != null) {
176:                    sb.append(", descriptor=");
177:                    sb.append(descriptor);
178:                }
179:
180:                // signature
181:                if (signature != null) {
182:                    sb.append(", signature=");
183:                    sb.append(signature);
184:                }
185:
186:                // exceptions
187:                if (value != null) {
188:                    sb.append(", value=");
189:                    sb.append(value);
190:                }
191:                sb.append("]");
192:                return sb.toString();
193:            }
194:
195:            /**
196:             * @return the field's access flags
197:             */
198:            public int getAccess() {
199:                return access;
200:            }
201:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.