Source Code Cross Referenced for MetaDataEntry.java in  » Web-Services-AXIS2 » kernal » org » apache » axis2 » util » 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 » Web Services AXIS2 » kernal » org.apache.axis2.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:
020:        package org.apache.axis2.util;
021:
022:        import javax.xml.namespace.QName;
023:        import java.io.Externalizable;
024:        import java.io.IOException;
025:        import java.io.ObjectInput;
026:        import java.io.ObjectOutput;
027:        import java.util.ArrayList;
028:
029:        /**
030:         * An internal class for holding a set of information
031:         * about an object.
032:         */
033:        public class MetaDataEntry implements  Externalizable {
034:            // serialization identifier
035:            private static final long serialVersionUID = 8978361069526299875L;
036:
037:            // supported revision levels, add a new level to manage compatible changes
038:            private static final int REVISION_1 = 1;
039:            // current revision level of this object
040:            private static final int revisionID = REVISION_1;
041:
042:            // data to keep on an object
043:
044:            private String className = null;
045:            private String qnameAsString = null;
046:            private String extraName = null;
047:
048:            // list of MetaDataEntry objects that are owned by the
049:            // original object referred to by this MetaDataEntry
050:            private ArrayList children = null;
051:
052:            // marker to indicate end-of-list
053:            public static String END_OF_LIST = "LAST_ENTRY";
054:
055:            /**
056:             * Simple constructor
057:             */
058:            public MetaDataEntry() {
059:            }
060:
061:            /**
062:             * Constructor
063:             * @param className name of the object class
064:             * @param qnameAsString an expanded version of the QName of this object
065:             */
066:            public MetaDataEntry(String className, String qnameAsString) {
067:                this .className = className;
068:                this .qnameAsString = qnameAsString;
069:            }
070:
071:            /**
072:             * Constructor
073:             * @param className name of the object class
074:             * @param qnameAsString an expanded version of the QName of this object
075:             * @param extraName an additional name associated withe the object
076:             */
077:            public MetaDataEntry(String className, String qnameAsString,
078:                    String extraName) {
079:                this .className = className;
080:                this .qnameAsString = qnameAsString;
081:                this .extraName = extraName;
082:            }
083:
084:            /**
085:             * Constructor
086:             * @param className name of the object class
087:             * @param qnameAsString an expanded version of the QName of this object
088:             * @param children an ArrayList containing MetaDataEntries for owned objects
089:             */
090:            public MetaDataEntry(String className, String qnameAsString,
091:                    ArrayList children) {
092:                this .className = className;
093:                this .qnameAsString = qnameAsString;
094:                this .children = children;
095:            }
096:
097:            /**
098:             * Get the class name
099:             *
100:             * @return the class name string
101:             */
102:            public String getClassName() {
103:                return className;
104:            }
105:
106:            /**
107:             * Set the class name
108:             *
109:             * @param c the class name string
110:             */
111:            public void setClassName(String c) {
112:                className = c;
113:            }
114:
115:            /**
116:             * Get the QName
117:             *
118:             * @return the QName based on the qnameAsString value
119:             */
120:            public QName getQName() {
121:                if (qnameAsString != null) {
122:                    return QName.valueOf(qnameAsString);
123:                } else {
124:                    return null;
125:                }
126:            }
127:
128:            /**
129:             * Set the QName
130:             *
131:             * @param q the QName
132:             */
133:            public void setQName(QName q) {
134:                if (q != null) {
135:                    qnameAsString = q.toString();
136:                } else {
137:                    qnameAsString = null;
138:                }
139:            }
140:
141:            /**
142:             * Set the QName
143:             *
144:             * @param n the QName as a string
145:             */
146:            public void setQName(String n) {
147:                qnameAsString = n;
148:            }
149:
150:            /**
151:             * Get the QName as a string
152:             *
153:             * @return the QName as a string
154:             */
155:            public String getQNameAsString() {
156:                return qnameAsString;
157:            }
158:
159:            /**
160:             * This is a convenience method.
161:             * Returns the string that is used as a name.
162:             *
163:             * @return the name
164:             */
165:            public String getName() {
166:                return qnameAsString;
167:            }
168:
169:            /**
170:             * Get the additional name associated with the object
171:             *
172:             * @return the additional name string
173:             */
174:            public String getExtraName() {
175:                return extraName;
176:            }
177:
178:            /**
179:             * Set the additional name associated with the object
180:             *
181:             * @param e the extra name string
182:             */
183:            public void setExtraName(String e) {
184:                extraName = e;
185:            }
186:
187:            /**
188:             * Indicates whether the list is empty or not
189:             *
190:             * @return false for a non-empty list, true for an empty list
191:             */
192:            public boolean isListEmpty() {
193:                return children == null || children.isEmpty();
194:            }
195:
196:            /**
197:             * Get the list
198:             *
199:             * @return the array list
200:             */
201:            public ArrayList getChildren() {
202:                return children;
203:            }
204:
205:            /**
206:             * Set the list
207:             *
208:             * @param L the ArrayList of MetaDataEntry objects
209:             */
210:            public void setChildren(ArrayList L) {
211:                children = L;
212:            }
213:
214:            /**
215:             * Add to the list
216:             *
217:             * @param e the MetaDataEntry object to add to the list
218:             */
219:            public void addToList(MetaDataEntry e) {
220:                if (children == null) {
221:                    children = new ArrayList();
222:                }
223:                children.add(e);
224:            }
225:
226:            /**
227:             * Remove the list
228:             */
229:            public void removeList() {
230:                children = null;
231:            }
232:
233:            // message strings
234:            private static final String UNSUPPORTED_SUID = "Serialization version ID is not supported.";
235:            private static final String UNSUPPORTED_REVID = "Revision ID is not supported.";
236:
237:            /**
238:             * Save the contents of this object
239:             *
240:             * @param out The stream to write the object contents to
241:             * @throws IOException
242:             */
243:            public void writeExternal(ObjectOutput out) throws IOException {
244:                // write out contents of this object
245:
246:                //---------------------------------------------------------
247:                // in order to handle future changes to the message 
248:                // context definition, be sure to maintain the 
249:                // object level identifiers
250:                //---------------------------------------------------------
251:                // serialization version ID
252:                out.writeLong(serialVersionUID);
253:
254:                // revision ID
255:                out.writeInt(revisionID);
256:
257:                //---------------------------------------------------------
258:                // various simple fields
259:                //---------------------------------------------------------
260:                ObjectStateUtils.writeString(out, className,
261:                        "MetaDataEntry.className");
262:                ObjectStateUtils.writeString(out, qnameAsString,
263:                        "MetaDataEntry.qnameAsString");
264:                ObjectStateUtils.writeString(out, extraName,
265:                        "MetaDataEntry.extraName");
266:                ObjectStateUtils.writeArrayList(out, children,
267:                        "MetaDataEntry.list");
268:
269:            }
270:
271:            /**
272:             * Restore the contents of the object that was
273:             * previously saved.
274:             * <p/>
275:             * NOTE: The field data must read back in the same order and type
276:             * as it was written.
277:             *
278:             * @param in The stream to read the object contents from
279:             * @throws IOException
280:             * @throws ClassNotFoundException
281:             */
282:            public void readExternal(ObjectInput in) throws IOException,
283:                    ClassNotFoundException {
284:
285:                // serialization version ID
286:                long suid = in.readLong();
287:
288:                // revision ID
289:                int revID = in.readInt();
290:
291:                // make sure the object data is in a version we can handle
292:                if (suid != serialVersionUID) {
293:                    throw new ClassNotFoundException(UNSUPPORTED_SUID);
294:                }
295:
296:                // make sure the object data is in a revision level we can handle
297:                if (revID != REVISION_1) {
298:                    throw new ClassNotFoundException(UNSUPPORTED_REVID);
299:                }
300:
301:                //---------------------------------------------------------
302:                // various simple fields
303:                //---------------------------------------------------------
304:
305:                className = ObjectStateUtils.readString(in,
306:                        "MetaDataEntry.className");
307:                qnameAsString = ObjectStateUtils.readString(in,
308:                        "MetaDataEntry.qnameAsString");
309:                extraName = ObjectStateUtils.readString(in,
310:                        "MetaDataEntry.extraName");
311:                children = ObjectStateUtils.readArrayList(in,
312:                        "MetaDataEntry.list");
313:
314:            }
315:
316:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.