Source Code Cross Referenced for CommonAnnotationMetadata.java in  » Testing » Ejb3Unit » com » bm » ejb3metadata » annotations » metadata » 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.metadata 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.bm.ejb3metadata.annotations.metadata;
002:
003:        import java.util.Arrays;
004:
005:        import com.bm.ejb3metadata.annotations.impl.JAnnotationResource;
006:        import com.bm.ejb3metadata.annotations.impl.JEjbEJB;
007:        import com.bm.ejb3metadata.annotations.impl.JavaxPersistenceContext;
008:        import com.bm.ejb3metadata.annotations.impl.JavaxPersistenceUnit;
009:        import com.bm.ejb3metadata.annotations.metadata.interfaces.ISharedMetadata;
010:
011:        /**
012:         * Defines Metadata shared by Field, Method and Classes. For example
013:         * @javax.annotation.EJB, @javax.annotation.Resource, etc.
014:         * @author Daniel Wiese
015:         */
016:        public class CommonAnnotationMetadata implements  ISharedMetadata {
017:
018:            /**
019:             * This field is used as a PersistenceContext.
020:             */
021:            private JavaxPersistenceContext javaxPersistenceContext = null;
022:
023:            /**
024:             * This field is used as a PersistenceUnit.
025:             */
026:            private JavaxPersistenceUnit javaxPersistenceUnit = null;
027:
028:            /**
029:             * Object representing @{@link javax.ejb.EJB} annotation.
030:             */
031:            private JEjbEJB jEjbEJB = null;
032:
033:            /**
034:             * Object representing @{@link javax.annotation.Resource} annotation.
035:             */
036:            private JAnnotationResource jAnnotationResource = null;
037:
038:            /**
039:             * @return JEjbEJB object representing javax.ejb.EJB annotation.
040:             */
041:            public JEjbEJB getJEjbEJB() {
042:                return jEjbEJB;
043:            }
044:
045:            /**
046:             * Set JAnnotationEJB object.
047:             * @param jEjbEJB object representing javax.annotation.EJB annotation.
048:             */
049:            public void setJEjbEJB(final JEjbEJB jEjbEJB) {
050:                this .jEjbEJB = jEjbEJB;
051:            }
052:
053:            /**
054:             * @return JAnnotationResource object representing javax.annotation.Resource
055:             *         annotation.
056:             */
057:            public JAnnotationResource getJAnnotationResource() {
058:                return jAnnotationResource;
059:            }
060:
061:            /**
062:             * Set JAnnotationResource object.
063:             * @param jAnnotationResource object representing javax.annotation.Resource
064:             *        annotation.
065:             */
066:            public void setJAnnotationResource(
067:                    final JAnnotationResource jAnnotationResource) {
068:                this .jAnnotationResource = jAnnotationResource;
069:            }
070:
071:            /**
072:             * @return true if this field is used as a persistence context.
073:             */
074:            public boolean isPersistenceContext() {
075:                return javaxPersistenceContext != null;
076:            }
077:
078:            /**
079:             * @return the persistence context infos.
080:             */
081:            public JavaxPersistenceContext getJavaxPersistenceContext() {
082:                return javaxPersistenceContext;
083:            }
084:
085:            /**
086:             * Sets the persistence context info on this field.
087:             * @param javaxPersistenceContext information on persistence context.
088:             */
089:            public void setJavaxPersistenceContext(
090:                    final JavaxPersistenceContext javaxPersistenceContext) {
091:                this .javaxPersistenceContext = javaxPersistenceContext;
092:            }
093:
094:            /**
095:             * @return true if this field is used as a persistence unit.
096:             */
097:            public boolean isPersistenceUnit() {
098:                return javaxPersistenceUnit != null;
099:            }
100:
101:            /**
102:             * @return the persistence unit infos.
103:             */
104:            public JavaxPersistenceUnit getJavaxPersistenceUnit() {
105:                return javaxPersistenceUnit;
106:            }
107:
108:            /**
109:             * Sets the persistence unit info on this field.
110:             * @param javaxPersistenceUnit information on persistence unit.
111:             */
112:            public void setJavaxPersistenceUnit(
113:                    final JavaxPersistenceUnit javaxPersistenceUnit) {
114:                this .javaxPersistenceUnit = javaxPersistenceUnit;
115:            }
116:
117:            /**
118:             * @return string representation
119:             */
120:            @Override
121:            public String toString() {
122:                StringBuilder sb = new StringBuilder();
123:                String titleIndent = " ";
124:                // classname
125:                sb.append(titleIndent);
126:                sb.append(this .getClass().getName().substring(
127:                        this .getClass().getPackage().getName().length() + 1));
128:                sb.append("[\n");
129:
130:                // jEjbEJB
131:                concatStringBuilder("jEjbEJB", jEjbEJB, sb);
132:
133:                // jAnnotationResource
134:                concatStringBuilder("jAnnotationResource", jAnnotationResource,
135:                        sb);
136:
137:                // javaxPersistenceContext
138:                concatStringBuilder("javaxPersistenceContext",
139:                        javaxPersistenceContext, sb);
140:
141:                // javaxPersistenceUnit
142:                concatStringBuilder("javaxPersistenceUnit",
143:                        javaxPersistenceUnit, sb);
144:
145:                sb.append(titleIndent);
146:                sb.append("]\n");
147:                return sb.toString();
148:            }
149:
150:            /**
151:             * Adds an entry to the given StringBuilder.
152:             * @param name the name of the entry.
153:             * @param object object to add.
154:             * @param sb the string builder object on which add the given element.
155:             * @param indent the indent to add at each line.
156:             */
157:            protected static void concatStringBuilder(final String name,
158:                    final Object object, final StringBuilder sb,
159:                    final String indent) {
160:                if (object != null) {
161:                    sb.append(indent);
162:                    sb.append(name);
163:                    sb.append("=");
164:                    // For arrays, use asList
165:                    if (object instanceof  Object[]) {
166:                        sb.append(Arrays.asList((Object[]) object));
167:                    } else {
168:                        sb.append(object);
169:                    }
170:                    sb.append("\n");
171:                }
172:            }
173:
174:            /**
175:             * Adds an entry to the given StringBuilder.
176:             * @param name the name of the entry.
177:             * @param object object to add.
178:             * @param sb the string builder object on which add the given element.
179:             */
180:            protected static void concatStringBuilder(final String name,
181:                    final Object object, final StringBuilder sb) {
182:                concatStringBuilder(name, object, sb, "    ");
183:            }
184:
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.