Source Code Cross Referenced for AccessibleImpl.java in  » IDE-Eclipse » jdt » org » eclipse » jdi » internal » 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 » IDE Eclipse » jdt » org.eclipse.jdi.internal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2005 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         * 
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdi.internal;
011:
012:        import java.lang.reflect.Field;
013:        import java.lang.reflect.Modifier;
014:
015:        import com.sun.jdi.Accessible;
016:
017:        /**
018:         * this class implements the corresponding interfaces
019:         * declared by the JDI specification. See the com.sun.jdi package
020:         * for more information.
021:         *
022:         */
023:        public abstract class AccessibleImpl extends MirrorImpl implements 
024:                Accessible {
025:            /** Modifier bit flag: Is synthetic. see MODIFIER_ACC_SYNTHETIC. */
026:            public static final int MODIFIER_SYNTHETIC = 0xf0000000;
027:            /** Modifier bit flag: Is public; may be accessed from outside its package. */
028:            public static final int MODIFIER_ACC_PUBLIC = 0x0001;
029:            /** Modifier bit flag: Is private; usable only within the defining class. */
030:            public static final int MODIFIER_ACC_PRIVATE = 0x0002;
031:            /** Modifier bit flag: Is protected; may be accessed within subclasses. */
032:            public static final int MODIFIER_ACC_PROTECTED = 0x0004;
033:            /** Modifier bit flag: Is static. */
034:            public static final int MODIFIER_ACC_STATIC = 0x0008;
035:            /** Modifier bit flag: Is final; no overriding is allowed. */
036:            public static final int MODIFIER_ACC_FINAL = 0x0010;
037:            /** Modifier bit flag: Is synchronized; wrap use in monitor lock. */
038:            public static final int MODIFIER_ACC_SYNCHRONIZED = 0x0020;
039:            /** Modifier bit flag: Treat superclass methods specially in invokespecial. */
040:            public static final int MODIFIER_ACC_SUPER = 0x0020;
041:            /** Modifier bit flag: Is bridge; the method is a synthetic method created to support generic types. */
042:            public static final int MODIFIER_ACC_BRIDGE = 0x0040;
043:            /** Modifier bit flag: Is volitile; cannot be reached. */
044:            public static final int MODIFIER_ACC_VOLITILE = 0x0040;
045:            /** Modifier bit flag: Is transient; not written or read by a persistent object manager. */
046:            public static final int MODIFIER_ACC_TRANSIENT = 0x0080;
047:            /** Modifier bit flag: Is varargs; the method has been declared with variable number of arguments. */
048:            public static final int MODIFIER_ACC_VARARGS = 0x0080;
049:            /** Modifier bit flag: Is enum; the field hold an element of an enumerated type. */
050:            public static final int MODIFIER_ACC_ENUM = 0x0100;
051:            /** Modifier bit flag: Is native; implemented in a language other than Java. */
052:            public static final int MODIFIER_ACC_NATIVE = 0x0100;
053:            /** Modifier bit flag: Is abstract; no implementation is provided. */
054:            public static final int MODIFIER_ACC_ABSTRACT = 0x0400;
055:            /** Modifier bit flag: Is strict;  the method floating-point mode is FP-strict*/
056:            public static final int MODIFIER_ACC_STRICT = 0x0800;
057:            /** Modifier bit flag: Is synthetic. see MODIFIER_SYNTHETIC. */
058:            public static final int MODIFIER_ACC_SYNTHETIC = 0x1000;
059:
060:            /** Mapping of command codes to strings. */
061:            private static String[] fgModifiers = null;
062:
063:            /**
064:             * Creates new instance.
065:             */
066:            public AccessibleImpl(String description, VirtualMachineImpl vmImpl) {
067:                super (description, vmImpl);
068:            }
069:
070:            /** 
071:             * @return Returns true if object is package private.
072:             */
073:            public boolean isPackagePrivate() {
074:                return !(isPrivate() || isPublic() || isProtected());
075:            }
076:
077:            /** 
078:             * @return Returns true if object is private.
079:             */
080:            public boolean isPrivate() {
081:                return (modifiers() & MODIFIER_ACC_PRIVATE) != 0;
082:            }
083:
084:            /** 
085:             * @return Returns true if object is pubic.
086:             */
087:            public boolean isPublic() {
088:                return (modifiers() & MODIFIER_ACC_PUBLIC) != 0;
089:            }
090:
091:            /** 
092:             * @return Returns true if object is protected.
093:             */
094:            public boolean isProtected() {
095:                return (modifiers() & MODIFIER_ACC_PROTECTED) != 0;
096:            }
097:
098:            /**
099:             * Retrieves constant mappings.
100:             */
101:            public static void getConstantMaps() {
102:                if (fgModifiers != null) {
103:                    return;
104:                }
105:
106:                Field[] fields = AccessibleImpl.class.getDeclaredFields();
107:                fgModifiers = new String[32];
108:
109:                for (int i = 0; i < fields.length; i++) {
110:                    Field field = fields[i];
111:                    int modifiers = field.getModifiers();
112:                    if ((modifiers & Modifier.PUBLIC) == 0
113:                            || (modifiers & Modifier.STATIC) == 0
114:                            || (modifiers & Modifier.FINAL) == 0)
115:                        continue;
116:
117:                    String name = field.getName();
118:                    if (!name.startsWith("MODIFIER_")) {//$NON-NLS-1$
119:                        continue;
120:                    }
121:
122:                    name = name.substring(9);
123:
124:                    try {
125:                        int value = field.getInt(null);
126:
127:                        for (int j = 0; j < 32; j++) {
128:                            if ((1 << j & value) != 0) {
129:                                fgModifiers[j] = name;
130:                                break;
131:                            }
132:                        }
133:                    } catch (IllegalAccessException e) {
134:                        // Will not occur for own class.
135:                    } catch (IllegalArgumentException e) {
136:                        // Should not occur.
137:                        // We should take care that all public static final constants
138:                        // in this class are numbers that are convertible to int.
139:                    }
140:                }
141:            }
142:
143:            /**
144:             * @return Returns an array with string representations of tags.
145:             */
146:            public static String[] getModifierStrings() {
147:                getConstantMaps();
148:                return fgModifiers;
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.