Source Code Cross Referenced for FieldRttiImpl.java in  » Aspect-oriented » aspectwerkz-2.0 » org » codehaus » aspectwerkz » joinpoint » impl » 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 » Aspect oriented » aspectwerkz 2.0 » org.codehaus.aspectwerkz.joinpoint.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**************************************************************************************
002:         * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved.                 *
003:         * http://aspectwerkz.codehaus.org                                                    *
004:         * ---------------------------------------------------------------------------------- *
005:         * The software in this package is published under the terms of the LGPL license      *
006:         * a copy of which has been included with this distribution in the license.txt file.  *
007:         **************************************************************************************/package org.codehaus.aspectwerkz.joinpoint.impl;
008:
009:        import org.codehaus.aspectwerkz.joinpoint.FieldRtti;
010:        import org.codehaus.aspectwerkz.joinpoint.Rtti;
011:
012:        import java.lang.ref.WeakReference;
013:        import java.lang.reflect.Field;
014:
015:        /**
016:         * Implementation for the field signature.
017:         *
018:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
019:         */
020:        public class FieldRttiImpl implements  FieldRtti {
021:            private final FieldSignatureImpl m_signature;
022:
023:            private WeakReference m_this Ref;
024:
025:            private WeakReference m_targetRef;
026:
027:            private Object m_fieldValue;
028:
029:            /**
030:             * Creates a new field RTTI.
031:             *
032:             * @param signature
033:             * @param thisInstance
034:             * @param targetInstance
035:             */
036:            public FieldRttiImpl(final FieldSignatureImpl signature,
037:                    final Object this Instance, final Object targetInstance) {
038:                m_signature = signature;
039:                m_this Ref = new WeakReference(this Instance);
040:                m_targetRef = new WeakReference(targetInstance);
041:            }
042:
043:            /**
044:             * Clones the RTTI instance.
045:             *
046:             * @param thisInstance
047:             * @param targetInstance
048:             * @return
049:             */
050:            public Rtti cloneFor(final Object this Instance,
051:                    final Object targetInstance) {
052:                return new FieldRttiImpl(m_signature, this Instance,
053:                        targetInstance);
054:            }
055:
056:            /**
057:             * Returns the target instance.
058:             *
059:             * @return the target instance
060:             */
061:            public Object getTarget() {
062:                return m_targetRef.get();
063:            }
064:
065:            /**
066:             * Returns the instance currently executing.
067:             *
068:             * @return the instance currently executing
069:             */
070:            public Object getThis() {
071:                return m_this Ref.get();
072:            }
073:
074:            /**
075:             * Returns the declaring class.
076:             *
077:             * @return the declaring class
078:             */
079:            public Class getDeclaringType() {
080:                return m_signature.getDeclaringType();
081:            }
082:
083:            /**
084:             * Returns the modifiers for the signature. <p/>Could be used like this:
085:             * <p/>
086:             * <pre>
087:             * boolean isPublic = java.lang.reflect.Modifier.isPublic(signature.getModifiers());
088:             * </pre>
089:             *
090:             * @return the mofifiers
091:             */
092:            public int getModifiers() {
093:                return m_signature.getModifiers();
094:            }
095:
096:            /**
097:             * Returns the name (f.e. name of method of field).
098:             *
099:             * @return the name
100:             */
101:            public String getName() {
102:                return m_signature.getName();
103:            }
104:
105:            /**
106:             * Returns the field.
107:             *
108:             * @return the field
109:             */
110:            public Field getField() {
111:                return m_signature.getField();
112:            }
113:
114:            /**
115:             * Returns the field type.
116:             *
117:             * @return the field type
118:             */
119:            public Class getFieldType() {
120:                return m_signature.getFieldType();
121:            }
122:
123:            /**
124:             * Returns the value of the field.
125:             *
126:             * @return the value of the field
127:             */
128:            public Object getFieldValue() {
129:                return m_fieldValue;
130:            }
131:
132:            /**
133:             * Sets the value of the field.
134:             *
135:             * @param fieldValue the value of the field
136:             */
137:            public void setFieldValue(final Object fieldValue) {
138:                m_fieldValue = fieldValue;
139:            }
140:
141:            /**
142:             * Returns a string representation of the signature.
143:             *
144:             * @return a string representation
145:             * @TODO: implement toString to something meaningful
146:             */
147:            public String toString() {
148:                return super .toString();
149:            }
150:
151:            /**
152:             * TODO: Needed for stupid JIT compiler. Remove for 2.0.
153:             *
154:             * @return
155:             */
156:            public Object[] getParameterValues() {
157:                return new Object[] { m_fieldValue };
158:            }
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.