Source Code Cross Referenced for StackMapFrameInfo.java in  » Development » yguardlib » com » yworks » yguard » obf » classfile » 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 » Development » yguardlib » com.yworks.yguard.obf.classfile 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.yworks.yguard.obf.classfile;
002:
003:        import java.io.DataInput;
004:        import java.io.DataOutput;
005:        import java.util.List;
006:        import java.util.Collection;
007:        import java.util.ArrayList;
008:
009:        /**
010:         * Representation of an Local Variable table entry.
011:         *
012:         * @author      Mark Welsh
013:         */
014:        public class StackMapFrameInfo {
015:            private VerificationTypeInfo[] verificationTypeInfoStack;
016:            private int u2_offset_delta;
017:            private VerificationTypeInfo[] verificationTypeInfoLocals;
018:            private int u1_frameType;
019:
020:            // Constants -------------------------------------------------------------
021:
022:            // Class Methods ---------------------------------------------------------
023:            public static StackMapFrameInfo create(DataInput din)
024:                    throws java.io.IOException {
025:                if (din == null)
026:                    throw new NullPointerException("DataInput cannot be null!");
027:                StackMapFrameInfo smfi = new StackMapFrameInfo();
028:                smfi.read(din);
029:                return smfi;
030:            }
031:
032:            // Instance Methods ------------------------------------------------------
033:            private StackMapFrameInfo() {
034:            }
035:
036:            /** Check for Utf8 references to constant pool and mark them. */
037:            protected void markUtf8Refs(ConstantPool pool) {
038:                if (u1_frameType < 64) {
039:                    // SAME
040:                } else if (u1_frameType >= 64 && u1_frameType <= 127) {
041:                    // SAME_LOCALS_1_STACK_ITEM;
042:                    verificationTypeInfoStack[0].markUtf8Refs(pool);
043:                } else if (u1_frameType == 247) {
044:                    // SAME_LOCALS_1_STACK_ITEM_EXTENDED
045:                    verificationTypeInfoStack[0].markUtf8Refs(pool);
046:                } else if (u1_frameType >= 248 && u1_frameType <= 250) {
047:                    // CHOP
048:                } else if (u1_frameType == 251) {
049:                    // SAME_FRAME_EXTENDED
050:                } else if (u1_frameType >= 252 && u1_frameType <= 254) {
051:                    // APPEND
052:                    for (int i = 0; i < verificationTypeInfoStack.length; i++) {
053:                        verificationTypeInfoStack[i].markUtf8Refs(pool);
054:                    }
055:                } else if (u1_frameType == 255) {
056:                    // FULL_FRAME
057:                    for (int i = 0; i < verificationTypeInfoLocals.length; i++) {
058:                        verificationTypeInfoLocals[i].markUtf8Refs(pool);
059:                    }
060:                    for (int i = 0; i < verificationTypeInfoStack.length; i++) {
061:                        verificationTypeInfoStack[i].markUtf8Refs(pool);
062:                    }
063:                } else {
064:                    throw new IllegalArgumentException("Unknown frame type "
065:                            + u1_frameType);
066:                }
067:            }
068:
069:            public Collection getVerificationTypeInfos() {
070:                ArrayList result = new ArrayList();
071:                if (verificationTypeInfoLocals != null) {
072:                    for (int i = 0; i < verificationTypeInfoLocals.length; i++) {
073:                        VerificationTypeInfo verificationTypeInfo = verificationTypeInfoLocals[i];
074:                        result.add(verificationTypeInfo);
075:                    }
076:                }
077:                if (verificationTypeInfoStack != null) {
078:                    for (int i = 0; i < verificationTypeInfoStack.length; i++) {
079:                        VerificationTypeInfo verificationTypeInfo = verificationTypeInfoStack[i];
080:                        result.add(verificationTypeInfo);
081:                    }
082:                }
083:                return result;
084:            }
085:
086:            private void read(DataInput din) throws java.io.IOException {
087:                verificationTypeInfoLocals = null;
088:                verificationTypeInfoStack = null;
089:                u1_frameType = din.readUnsignedByte();
090:                if (u1_frameType < 64) {
091:                    // SAME
092:                } else if (u1_frameType >= 64 && u1_frameType <= 127) {
093:                    // SAME_LOCALS_1_STACK_ITEM;
094:                    verificationTypeInfoStack = new VerificationTypeInfo[1];
095:                    verificationTypeInfoStack[0] = VerificationTypeInfo
096:                            .create(din);
097:                } else if (u1_frameType == 247) {
098:                    // SAME_LOCALS_1_STACK_ITEM_EXTENDED
099:                    u2_offset_delta = din.readUnsignedShort();
100:                    verificationTypeInfoStack = new VerificationTypeInfo[1];
101:                    verificationTypeInfoStack[0] = VerificationTypeInfo
102:                            .create(din);
103:                } else if (u1_frameType >= 248 && u1_frameType <= 250) {
104:                    // CHOP
105:                    u2_offset_delta = din.readUnsignedShort();
106:                } else if (u1_frameType == 251) {
107:                    // SAME_FRAME_EXTENDED
108:                    u2_offset_delta = din.readUnsignedShort();
109:                } else if (u1_frameType >= 252 && u1_frameType <= 254) {
110:                    // APPEND
111:                    u2_offset_delta = din.readUnsignedShort();
112:                    int count = u1_frameType - 251;
113:                    verificationTypeInfoStack = new VerificationTypeInfo[count];
114:                    for (int i = 0; i < verificationTypeInfoStack.length; i++) {
115:                        verificationTypeInfoStack[i] = VerificationTypeInfo
116:                                .create(din);
117:                    }
118:                } else if (u1_frameType == 255) {
119:                    // FULL_FRAME
120:                    u2_offset_delta = din.readUnsignedShort();
121:                    verificationTypeInfoLocals = new VerificationTypeInfo[din
122:                            .readUnsignedShort()];
123:                    for (int i = 0; i < verificationTypeInfoLocals.length; i++) {
124:                        verificationTypeInfoLocals[i] = VerificationTypeInfo
125:                                .create(din);
126:                    }
127:                    verificationTypeInfoStack = new VerificationTypeInfo[din
128:                            .readUnsignedShort()];
129:                    for (int i = 0; i < verificationTypeInfoStack.length; i++) {
130:                        verificationTypeInfoStack[i] = VerificationTypeInfo
131:                                .create(din);
132:                    }
133:                } else {
134:                    throw new IllegalArgumentException("Unknown frame type "
135:                            + u1_frameType);
136:                }
137:            }
138:
139:            /** Export the representation to a DataOutput stream. */
140:            public void write(DataOutput dout) throws java.io.IOException {
141:                dout.writeByte(u1_frameType);
142:                if (u1_frameType < 64) {
143:                    // SAME
144:                } else if (u1_frameType >= 64 && u1_frameType <= 127) {
145:                    // SAME_LOCALS_1_STACK_ITEM;
146:                    verificationTypeInfoStack[0].write(dout);
147:                } else if (u1_frameType == 247) {
148:                    // SAME_LOCALS_1_STACK_ITEM_EXTENDED
149:                    dout.writeShort(u2_offset_delta);
150:                    verificationTypeInfoStack[0].write(dout);
151:                } else if (u1_frameType >= 248 && u1_frameType <= 250) {
152:                    // CHOP
153:                    dout.writeShort(u2_offset_delta);
154:                } else if (u1_frameType == 251) {
155:                    // SAME_FRAME_EXTENDED
156:                    dout.writeShort(u2_offset_delta);
157:                } else if (u1_frameType >= 252 && u1_frameType <= 254) {
158:                    // APPEND
159:                    dout.writeShort(u2_offset_delta);
160:                    for (int i = 0; i < verificationTypeInfoStack.length; i++) {
161:                        verificationTypeInfoStack[i].write(dout);
162:                    }
163:                } else if (u1_frameType == 255) {
164:                    // FULL_FRAME
165:                    dout.writeShort(u2_offset_delta);
166:                    dout.writeShort(verificationTypeInfoLocals.length);
167:                    for (int i = 0; i < verificationTypeInfoLocals.length; i++) {
168:                        verificationTypeInfoLocals[i].write(dout);
169:                    }
170:                    dout.writeShort(verificationTypeInfoStack.length);
171:                    for (int i = 0; i < verificationTypeInfoStack.length; i++) {
172:                        verificationTypeInfoStack[i].write(dout);
173:                    }
174:                } else {
175:                    throw new IllegalArgumentException("Unknown frame type "
176:                            + u1_frameType);
177:                }
178:            }
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.