Source Code Cross Referenced for InstanceProperties.java in  » IDE-Netbeans » server » org » netbeans » api » server » properties » 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 » IDE Netbeans » server » org.netbeans.api.server.properties 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * If you wish your version of this file to be governed by only the CDDL
025:         * or only the GPL Version 2, indicate your decision by adding
026:         * "[Contributor] elects to include this software in this distribution
027:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
028:         * single choice of license, a recipient has the option to distribute
029:         * your version of this file under either the CDDL, the GPL Version 2 or
030:         * to extend the choice of license to its licensees as provided above.
031:         * However, if you add GPL Version 2 code and therefore, elected the GPL
032:         * Version 2 license, then the option applies only if the new code is
033:         * made subject to such option by the copyright holder.
034:         *
035:         * Contributor(s):
036:         *
037:         * Portions Copyrighted 2008 Sun Microsystems, Inc.
038:         */
039:
040:        package org.netbeans.api.server.properties;
041:
042:        /**
043:         * The set of properties to persist. Every property set is persisted unless
044:         * the whole object is not removed by the {@link #remove()} call.
045:         * <p>
046:         * In the scope of namespace used in {@link InstancePropertiesManager}
047:         * the object has assigned unique id identifying it.
048:         *
049:         * @author Petr Hejl
050:         */
051:        public abstract class InstanceProperties {
052:
053:            private final String id;
054:
055:            /**
056:             * Creates the new InstanceProperties.
057:             *
058:             * @param id id of the properties, unique in the scope of the namespace
059:             * @see InstancePropertiesManager
060:             */
061:            public InstanceProperties(String id) {
062:                this .id = id;
063:            }
064:
065:            /**
066:             * Returns unique id of these properties. It is guaranteed that this id is
067:             * unique in the scope of single namespace used in manager (however it
068:             * is not related directly to it).
069:             * <p>
070:             * Client may use it for its own purposes (don't have to), but client
071:             * can't influence the actual value of id in any way.
072:             *
073:             * @return id of the properties unique in the scope of the property set
074:             * @see InstancePropertiesManager
075:             * @see InstancePropertiesManager#createProperties(String)
076:             */
077:            public final String getId() {
078:                return id;
079:            }
080:
081:            /**
082:             * Returns the value of the given property. If the value was not assigned
083:             * to the property default value is returned. This method is designed to be
084:             * used in conjuction with {@link #putString(String, String)}.
085:             *
086:             * @param key name of the property
087:             * @param def default value
088:             * @return the value of the property or defined default value
089:             */
090:            public abstract String getString(String key, String def);
091:
092:            /**
093:             * Associates the specified value with the specified property. This
094:             * method is expected to be used in conjuction with
095:             * {@link #getString(String, String)}.
096:             *
097:             * @param key name of the property
098:             * @param value value to set
099:             */
100:            public abstract void putString(String key, String value);
101:
102:            /**
103:             * Returns the value of the given property. If the value was not assigned
104:             * to the property or it is not valid integer the default value is returned.
105:             * Valid stored values are "true" and "false" (case insensitive). This
106:             * method is designed to be used in conjuction with
107:             * {@link #putBoolean(String, boolean)}.
108:             *
109:             * @param key name of the property
110:             * @param def default value
111:             * @return the value of the property or defined default value
112:             */
113:            public abstract boolean getBoolean(String key, boolean def);
114:
115:            /**
116:             * Associates the specified value with the specified property. This
117:             * method is expected to be used in conjuction with
118:             * {@link #getBoolean(String, boolean)}.
119:             *
120:             * @param key name of the property
121:             * @param value value to set
122:             */
123:            public abstract void putBoolean(String key, boolean value);
124:
125:            /**
126:             * Returns the value of the given property. If the value was not assigned
127:             * to the property or it is not valid integer the default value is returned.
128:             * Valid string values associated with the property are values parseable
129:             * with {@link java.lang.Integer#parseInt(String)}. However this method
130:             * is designed to be used in conjuction with {@link #putInt(String, int)}.
131:             *
132:             * @param key name of the property
133:             * @param def default value
134:             * @return the value of the property or defined default value
135:             */
136:            public abstract int getInt(String key, int def);
137:
138:            /**
139:             * Associates the specified value with the specified property. This
140:             * method is expected to be used in conjuction with
141:             * {@link #getInt(String, int)}.
142:             *
143:             * @param key name of the property
144:             * @param value value to set
145:             */
146:            public abstract void putInt(String key, int value);
147:
148:            /**
149:             * Returns the value of the given property. If the value was not assigned
150:             * to the property or it is not valid long the default value is returned.
151:             * Valid string values associated with the property are values parseable
152:             * with {@link java.lang.Long#parseLong(String)}. However this method
153:             * is designed to be used in conjuction with {@link #putLong(String, long)}.
154:             *
155:             * @param key name of the property
156:             * @param def default value
157:             * @return the value of the property or defined default value
158:             */
159:            public abstract long getLong(String key, long def);
160:
161:            /**
162:             * Associates the specified value with the specified property. This
163:             * method is expected to be used in conjuction with
164:             * {@link #getLong(String, long)}.
165:             *
166:             * @param key name of the property
167:             * @param value value to set
168:             */
169:            public abstract void putLong(String key, long value);
170:
171:            /**
172:             * Returns the value of the given property. If the value was not assigned
173:             * to the property or it is not valid float the default value is returned.
174:             * Valid string values associated with the property are values parseable
175:             * with {@link java.lang.Float#parseFloat(String)}. However this method
176:             * is designed to be used in conjuction with
177:             * {@link #putFloat(String, float)}.
178:             *
179:             * @param key name of the property
180:             * @param def default value
181:             * @return the value of the property or defined default value
182:             */
183:            public abstract float getFloat(String key, float def);
184:
185:            /**
186:             * Associates the specified value with the specified property. This
187:             * method is expected to be used in conjuction with
188:             * {@link #getFloat(String, float)}.
189:             *
190:             * @param key name of the property
191:             * @param value value to set
192:             */
193:            public abstract void putFloat(String key, float value);
194:
195:            /**
196:             * Returns the value of the given property. If the value was not assigned
197:             * to the property or it is not valid double the default value is returned.
198:             * Valid string values associated with the property are values parseable
199:             * with {@link java.lang.Double#parseDouble(String)}. However this method
200:             * is designed to be used in conjuction with
201:             * {@link #putDouble(String, double)}.
202:             *
203:             * @param key name of the property
204:             * @param def default value
205:             * @return the value of the property or defined default value
206:             */
207:            public abstract double getDouble(String key, double def);
208:
209:            /**
210:             * Associates the specified value with the specified property. This
211:             * method is expected to be used in conjuction with
212:             * {@link #getDouble(String, double)}.
213:             *
214:             * @param key name of the property
215:             * @param value value to set
216:             */
217:            public abstract void putDouble(String key, double value);
218:
219:            /**
220:             * Removes the value of the given property, if any.
221:             *
222:             * @param key name of the property
223:             */
224:            public abstract void removeKey(String key);
225:
226:            /**
227:             * Removes this instance from the persistent space. All values of
228:             * previously set are lost. The result of call to
229:             * {@link InstancePropertiesManager#getProperties(String)} with appropriate
230:             * parameter will not contain this set of properties anymore.
231:             * <p>
232:             * Return value of any method after removal is not defined and most
233:             * likely will lead to {@link java.lang.IllegalStateException}.
234:             */
235:            public abstract void remove();
236:
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.