Source Code Cross Referenced for Variable.java in  » Web-Services » restlet-1.0.8 » org » restlet » 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 » restlet 1.0.8 » org.restlet.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2007 Noelios Consulting.
003:         * 
004:         * The contents of this file are subject to the terms of the Common Development
005:         * and Distribution License (the "License"). You may not use this file except in
006:         * compliance with the License.
007:         * 
008:         * You can obtain a copy of the license at
009:         * http://www.opensource.org/licenses/cddl1.txt See the License for the specific
010:         * language governing permissions and limitations under the License.
011:         * 
012:         * When distributing Covered Code, include this CDDL HEADER in each file and
013:         * include the License file at http://www.opensource.org/licenses/cddl1.txt If
014:         * applicable, add the following below this CDDL HEADER, with the fields
015:         * enclosed by brackets "[]" replaced with your own identifying information:
016:         * Portions Copyright [yyyy] [name of copyright owner]
017:         */
018:
019:        package org.restlet.util;
020:
021:        /**
022:         * Variable descriptor for reference templates.
023:         * 
024:         * @see Template
025:         * @author Jerome Louvel (contact@noelios.com)
026:         */
027:        public final class Variable {
028:            /** Matches all characters. */
029:            public static final int TYPE_ALL = 1;
030:
031:            /** Matches all alphabetical characters. */
032:            public static final int TYPE_ALPHA = 2;
033:
034:            /** Matches all alphabetical and digital characters. */
035:            public static final int TYPE_ALPHA_DIGIT = 3;
036:
037:            /** Matches all digital characters. */
038:            public static final int TYPE_DIGIT = 4;
039:
040:            /** Matches all URI characters. */
041:            public static final int TYPE_URI_ALL = 5;
042:
043:            /** Matches URI fragment characters. */
044:            public static final int TYPE_URI_FRAGMENT = 6;
045:
046:            /** Matches URI query characters. */
047:            public static final int TYPE_URI_QUERY = 7;
048:
049:            /** Matches URI scheme characters. */
050:            public static final int TYPE_URI_SCHEME = 8;
051:
052:            /** Matches URI segment characters. */
053:            public static final int TYPE_URI_SEGMENT = 9;
054:
055:            /** Matches unreserved URI characters. */
056:            public static final int TYPE_URI_UNRESERVED = 10;
057:
058:            /** Matches all alphabetical and digital characters plus the underscore. */
059:            public static final int TYPE_WORD = 11;
060:
061:            /** The type of variable. See TYPE_* constants. */
062:            private int type;
063:
064:            /** The default value to use if the key couldn't be found in the model. */
065:            private String defaultValue;
066:
067:            /** Indicates if the variable is required or optional. */
068:            private boolean required;
069:
070:            /**
071:             * Indicates if the value is fixed, in which case the "defaultValue"
072:             * property is always used.
073:             */
074:            private boolean fixed;
075:
076:            /**
077:             * Default constructor. Type is TYPE_ALL, default value is "", required is
078:             * true and fixed is false.
079:             */
080:            public Variable() {
081:                this (Variable.TYPE_ALL, "", true, false);
082:            }
083:
084:            /**
085:             * Constructor. Default value is "", required is true and fixed is false.
086:             * 
087:             * @param type
088:             *            The type of variable. See TYPE_* constants.
089:             */
090:            public Variable(int type) {
091:                this (type, "", true, false);
092:            }
093:
094:            /**
095:             * Constructor.
096:             * 
097:             * @param type
098:             *            The type of variable. See TYPE_* constants.
099:             * @param defaultValue
100:             *            The default value to use if the key couldn't be found in the
101:             *            model.
102:             * @param required
103:             *            Indicates if the variable is required or optional.
104:             * @param fixed
105:             *            Indicates if the value is fixed, in which case the
106:             *            "defaultValue" property is always used.
107:             */
108:            public Variable(int type, String defaultValue, boolean required,
109:                    boolean fixed) {
110:                this .type = type;
111:                this .defaultValue = defaultValue;
112:                this .required = required;
113:                this .fixed = fixed;
114:            }
115:
116:            /**
117:             * Returns the type of variable. See TYPE_* constants.
118:             * 
119:             * @return The type of variable. See TYPE_* constants.
120:             */
121:            public int getType() {
122:                return this .type;
123:            }
124:
125:            /**
126:             * Returns the default value to use if the key couldn't be found in the
127:             * model.
128:             * 
129:             * @return The default value to use if the key couldn't be found in the
130:             *         model.
131:             */
132:            public String getDefaultValue() {
133:                return this .defaultValue;
134:            }
135:
136:            /**
137:             * Returns true if the variable is required or optional.
138:             * 
139:             * @return True if the variable is required or optional.
140:             */
141:            public boolean isRequired() {
142:                return this .required;
143:            }
144:
145:            /**
146:             * Returns true if the value is fixed, in which case the "defaultValue"
147:             * property is always used.
148:             * 
149:             * @return True if the value is fixed, in which case the "defaultValue"
150:             *         property is always used.
151:             */
152:            public boolean isFixed() {
153:                return this.fixed;
154:            }
155:
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.