Source Code Cross Referenced for List.java in  » Web-Services » xins » org » xins » common » types » standard » 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 » xins » org.xins.common.types.standard 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: List.java,v 1.15 2007/09/18 11:21:04 agoubard Exp $
003:         *
004:         * Copyright 2003-2007 Orange Nederland Breedband B.V.
005:         * See the COPYRIGHT file for redistribution and use restrictions.
006:         */
007:        package org.xins.common.types.standard;
008:
009:        import org.xins.common.MandatoryArgumentChecker;
010:        import org.xins.common.types.ItemList;
011:        import org.xins.common.types.TypeValueException;
012:
013:        /**
014:         * Standard type <em>_list</em>.
015:         *
016:         * @version $Revision: 1.15 $ $Date: 2007/09/18 11:21:04 $
017:         * @author <a href="mailto:anthony.goubard@japplis.com">Anthony Goubard</a>
018:         *
019:         * @since XINS 1.5.0.
020:         */
021:        public final class List extends org.xins.common.types.List {
022:
023:            /**
024:             * The only instance of this class. This field is never <code>null</code>.
025:             */
026:            public static final List SINGLETON = new List();
027:
028:            /**
029:             * Constructs a new <code>List</code>.
030:             * This constructor is private, the field {@link #SINGLETON} should be
031:             * used.
032:             */
033:            private List() {
034:                super ("_list", Text.SINGLETON);
035:            }
036:
037:            public ItemList createList() {
038:                return new Value();
039:            }
040:
041:            /**
042:             * Constructs a <code>List.Value</code> from the specified string
043:             * which is guaranteed to be non-<code>null</code>.
044:             *
045:             * @param string
046:             *    the string to convert, cannot be <code>null</code>.
047:             *
048:             * @return
049:             *    the {@link List.Value} object, never <code>null</code>.
050:             *
051:             * @throws IllegalArgumentException
052:             *    if <code>string == null</code>.
053:             *
054:             * @throws TypeValueException
055:             *    if the specified string does not represent a valid value for this
056:             *    type.
057:             */
058:            public static Value fromStringForRequired(String string)
059:                    throws IllegalArgumentException, TypeValueException {
060:
061:                // Check preconditions
062:                MandatoryArgumentChecker.check("string", string);
063:
064:                return (Value) SINGLETON.fromString(string);
065:            }
066:
067:            /**
068:             * Constructs a <code>List.Value</code> from the specified string.
069:             *
070:             * @param string
071:             *    the string to convert, can be <code>null</code>.
072:             *
073:             * @return
074:             *    the {@link List.Value}, or <code>null</code> if
075:             *    <code>string == null</code>.
076:             *
077:             * @throws TypeValueException
078:             *    if the specified string does not represent a valid value for this
079:             *    type.
080:             */
081:            public static Value fromStringForOptional(String string)
082:                    throws TypeValueException {
083:                return (Value) SINGLETON.fromString(string);
084:            }
085:
086:            /**
087:             * Converts the specified <code>List.Value</code> to a string.
088:             *
089:             * @param value
090:             *    the value to convert, can be <code>null</code>.
091:             *
092:             * @return
093:             *    the textual representation of the value, or <code>null</code> if and
094:             *    only if <code>value == null</code>.
095:             */
096:            public static String toString(Value value) {
097:
098:                // Short-circuit if the argument is null
099:                if (value == null) {
100:                    return null;
101:                }
102:                return SINGLETON.toString((ItemList) value);
103:            }
104:
105:            public String getDescription() {
106:                return "An ampersand separated list of text.";
107:            }
108:
109:            /**
110:             * Inner class that represents a list of String.
111:             */
112:            public static final class Value extends ItemList {
113:
114:                /**
115:                 * Add a new element in the list.
116:                 *
117:                 * @param value
118:                 *    the new value to add, cannot be <code>null</code>.
119:                 *
120:                 * @throws IllegalArgumentException
121:                 *    if <code>value == null</code>.
122:                 */
123:                public void add(String value) throws IllegalArgumentException {
124:                    MandatoryArgumentChecker.check("value", value);
125:                    addItem(value);
126:                }
127:
128:                /**
129:                 * Get an element from the list.
130:                 *
131:                 * @param index
132:                 *    The position of the required element.
133:                 *
134:                 * @return
135:                 *    The element at the specified position, cannot be <code>null</code>.
136:                 */
137:                public String get(int index) {
138:                    return (String) getItem(index);
139:                }
140:            }
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.