Source Code Cross Referenced for CtPrimitiveType.java in  » Byte-Code » Javassist » javassist » 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 » Byte Code » Javassist » javassist 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Javassist, a Java-bytecode translator toolkit.
003:         * Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.
004:         *
005:         * The contents of this file are subject to the Mozilla Public License Version
006:         * 1.1 (the "License"); you may not use this file except in compliance with
007:         * the License.  Alternatively, the contents of this file may be used under
008:         * the terms of the GNU Lesser General Public License Version 2.1 or later.
009:         *
010:         * Software distributed under the License is distributed on an "AS IS" basis,
011:         * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
012:         * for the specific language governing rights and limitations under the
013:         * License.
014:         */
015:
016:        package javassist;
017:
018:        /**
019:         * An instance of <code>CtPrimitiveType</code> represents a primitive type.
020:         * It is obtained from <code>CtClass</code>.
021:         */
022:        public final class CtPrimitiveType extends CtClass {
023:            private char descriptor;
024:            private String wrapperName;
025:            private String getMethodName;
026:            private String mDescriptor;
027:            private int returnOp;
028:            private int arrayType;
029:            private int dataSize;
030:
031:            CtPrimitiveType(String name, char desc, String wrapper,
032:                    String methodName, String mDesc, int opcode, int atype,
033:                    int size) {
034:                super (name);
035:                descriptor = desc;
036:                wrapperName = wrapper;
037:                getMethodName = methodName;
038:                mDescriptor = mDesc;
039:                returnOp = opcode;
040:                arrayType = atype;
041:                dataSize = size;
042:            }
043:
044:            /**
045:             * Returns <code>true</code> if this object represents a primitive
046:             * Java type: boolean, byte, char, short, int, long, float, double,
047:             * or void.
048:             */
049:            public boolean isPrimitive() {
050:                return true;
051:            }
052:
053:            /**
054:             * Returns the descriptor representing this type.
055:             * For example, if the type is int, then the descriptor is I.
056:             */
057:            public char getDescriptor() {
058:                return descriptor;
059:            }
060:
061:            /**
062:             * Returns the name of the wrapper class.
063:             * For example, if the type is int, then the wrapper class is
064:             * <code>java.lang.Integer</code>.
065:             */
066:            public String getWrapperName() {
067:                return wrapperName;
068:            }
069:
070:            /**
071:             * Returns the name of the method for retrieving the value
072:             * from the wrapper object.
073:             * For example, if the type is int, then the method name is
074:             * <code>intValue</code>.
075:             */
076:            public String getGetMethodName() {
077:                return getMethodName;
078:            }
079:
080:            /**
081:             * Returns the descriptor of the method for retrieving the value
082:             * from the wrapper object.
083:             * For example, if the type is int, then the method descriptor is
084:             * <code>()I</code>.
085:             */
086:            public String getGetMethodDescriptor() {
087:                return mDescriptor;
088:            }
089:
090:            /**
091:             * Returns the opcode for returning a value of the type.
092:             * For example, if the type is int, then the returned opcode is
093:             * <code>javassit.bytecode.Opcode.IRETURN</code>.
094:             */
095:            public int getReturnOp() {
096:                return returnOp;
097:            }
098:
099:            /**
100:             * Returns the array-type code representing the type.
101:             * It is used for the newarray instruction.
102:             * For example, if the type is int, then this method returns
103:             * <code>javassit.bytecode.Opcode.T_INT</code>.
104:             */
105:            public int getArrayType() {
106:                return arrayType;
107:            }
108:
109:            /**
110:             * Returns the data size of the primitive type.
111:             * If the type is long or double, this method returns 2.
112:             * Otherwise, it returns 1.
113:             */
114:            public int getDataSize() {
115:                return dataSize;
116:            }
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.