Source Code Cross Referenced for Element.java in  » 6.0-JDK-Modules » j2me » javax » microedition » xml » rpc » 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 » 6.0 JDK Modules » j2me » javax.microedition.xml.rpc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  
003:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
004:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005:         * 
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU General Public License version
008:         * 2 only, as published by the Free Software Foundation.
009:         * 
010:         * This program is distributed in the hope that it will be useful, but
011:         * WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013:         * General Public License version 2 for more details (a copy is
014:         * included at /legal/license.txt).
015:         * 
016:         * You should have received a copy of the GNU General Public License
017:         * version 2 along with this work; if not, write to the Free Software
018:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019:         * 02110-1301 USA
020:         * 
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022:         * Clara, CA 95054 or visit www.sun.com if you need additional
023:         * information or have any questions.
024:         */
025:
026:        package javax.microedition.xml.rpc;
027:
028:        import javax.xml.namespace.QName;
029:        import javax.xml.rpc.JAXRPCException;
030:
031:        /**
032:         * The class <code>Element</code> is a special Object
033:         * used to represent an xsd:element defined in a Web Service's
034:         * WSDL definition. An element can have the additional properties
035:         * of being an array, being nillable, and has minOccurs and
036:         * maxOccurs values.
037:         *
038:         * @version 0.1
039:         * @see javax.xml.rpc.Stub
040:         * @see javax.microedition.xml.rpc.Operation
041:         */
042:        public class Element extends Type {
043:
044:            /**
045:             * The QName of this element
046:             */
047:            public final QName name;
048:
049:            /**
050:             * The Type of this Element's content.
051:             */
052:            public final Type contentType;
053:
054:            /**
055:             * True if this element is nillable
056:             */
057:            public final boolean isNillable;
058:
059:            /**
060:             * True if this element is an array
061:             */
062:            public final boolean isArray;
063:
064:            /**
065:             * True if this element is optional, that is, its minOccurs
066:             * is defined as being 0.
067:             */
068:            public final boolean isOptional;
069:
070:            /**
071:             * The 'minOccurs' attribute of this element. -1 if this
072:             * element has no 'minOccurs' attribute.
073:             */
074:            public final int minOccurs;
075:
076:            /**
077:             * The 'maxOccurs' attribute of this element. -1 if this
078:             * element has no 'maxOccurs' attribute.
079:             */
080:            public final int maxOccurs;
081:
082:            /**
083:             * Constant use to indicate that <code>maxOccurrs</code>
084:             * is unbounded.
085:             */
086:            public final static int UNBOUNDED = -1;
087:
088:            /**
089:             * Construct an Element with the given properties.
090:             * This Type subclass will have an <code>intValue()</code> of 9.
091:             *
092:             * @param name the QName of this element
093:             * @param type the Type of this element's content
094:             * @param minOccurs indicates the minimum number of times this
095:             *                  element can occur. A value of '0' indicates
096:             *                  this element is optional.
097:             * @param maxOccurs indicates the maximum number of times this
098:             *                  element can occur. A value > 1, in addition
099:             *                  to <code>isArray</code> being true, indicates
100:             *                  this element is an array.
101:             * @throws IllegalArgumentException
102:             * <UL>
103:             * <LI>if <code>minOccurs < 0</code>, or
104:             * <LI>if <code>name</code> or <code>type</code> are <code>null</code> 
105:             * <LI>if <code>type</code> is an instance of <code>Element</code>
106:             * </UL>
107:             */
108:            public Element(QName name, Type type, int minOccurs, int maxOccurs,
109:                    boolean nillable) throws IllegalArgumentException {
110:                super (9);
111:
112:                if (name == null || type == null || type instanceof  Element) {
113:                    throw new IllegalArgumentException();
114:                }
115:
116:                this .name = name;
117:                this .contentType = type;
118:
119:                if (minOccurs < 0 || (maxOccurs <= 0 && maxOccurs != UNBOUNDED)) {
120:                    throw new IllegalArgumentException(
121:                            "[min|max]Occurs must >= 0");
122:                } else if (maxOccurs < minOccurs && maxOccurs != UNBOUNDED) {
123:                    throw new IllegalArgumentException(
124:                            "maxOccurs must > minOccurs");
125:                }
126:                this .minOccurs = minOccurs;
127:                this .isOptional = (minOccurs == 0);
128:                this .maxOccurs = maxOccurs;
129:                this .isArray = (maxOccurs > 1 || maxOccurs == UNBOUNDED);
130:                this .isNillable = nillable;
131:            }
132:
133:            /**
134:             * Construct an Element with the given properties. The defaults for
135:             * the unspecified properties are:
136:             * <UL>
137:             * <LI>minOccurs = 1
138:             * <LI>maxOccurs = 1
139:             * <LI>isOptional = false
140:             * <LI>isArray = false
141:             * <LI>nillable = false
142:             * </UL>
143:             *
144:             * This Type subclass will have an <code>intValue()</code> of 9.
145:             *
146:             * @param name the QName of this element
147:             * @param type the Type of this element's content
148:             *
149:             * @throws IllegalArgumentException
150:             * <UL>
151:             * <LI>if <code>name</code> or <code>type</code> are <code>null</code> 
152:             * <LI>if <code>type</code> is an instance of <code>Element</code>
153:             * </UL>
154:             */
155:            public Element(QName name, Type type)
156:                    throws IllegalArgumentException
157:
158:            {
159:                super (9);
160:
161:                if (name == null || type == null || type instanceof  Element) {
162:                    throw new IllegalArgumentException();
163:                }
164:
165:                this .name = name;
166:                this .contentType = type;
167:                this .minOccurs = 1;
168:                this .maxOccurs = 1;
169:                this .isArray = false;
170:                this .isOptional = false;
171:                this .isNillable = false;
172:            }
173:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.