Java Doc for EditableProperties.java in  » IDE-Netbeans » project.ant » org » netbeans » spi » project » support » ant » 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 » project.ant » org.netbeans.spi.project.support.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.netbeans.spi.project.support.ant.EditableProperties

EditableProperties
final public class EditableProperties extends AbstractMap implements Cloneable(Code)
Similar to java.util.Properties but designed to retain additional information needed for safe hand-editing. Useful for various *.properties in a project:
  1. Can associate comments with particular entries.
  2. Order of entries preserved during modifications whenever possible.
  3. VCS-friendly: lines which are not semantically modified are not textually modified.
  4. Can automatically insert line breaks in new or modified values at positions that are likely to be semantically meaningful, e.g. between path components
The file format (including encoding etc.) is compatible with the regular JRE implementation. Only (non-null) String is supported for keys and values. This class is not thread-safe; use only from a single thread, or use java.util.Collections.synchronizedMap .
author:
   Jesse Glick, David Konecny



Constructor Summary
public  EditableProperties()
     Creates empty instance whose items will not be alphabetized.
public  EditableProperties(boolean alphabetize)
     Creates empty instance.
public  EditableProperties(Map<String, String> map)
     Creates instance from an existing map.

Method Summary
public  Objectclone()
    
public  EditablePropertiescloneProperties()
     Create an exact copy of this properties object.
public  Set<Map.Entry<String, String>>entrySet()
     Returns a set view of the mappings ordered according to their file position.
public  String[]getComment(String key)
     Returns comment associated with the property.
public  StringgetProperty(String key)
     Convenience method to get a property as a string.
public  voidload(InputStream stream)
     Load properties from a stream.
public  Stringput(String key, String value)
    
public  voidsetComment(String key, String[] comment, boolean separate)
     Create comment for the property.
public  StringsetProperty(String key, String value)
     Convenience method to set a property.
public  StringsetProperty(String key, String[] value)
     Sets a property to a value broken into segments for readability. Same behavior as EditableProperties.setProperty(String,String) with the difference that each item will be stored on its own line of text.
public  voidstore(OutputStream stream)
     Store properties to a stream.


Constructor Detail
EditableProperties
public EditableProperties()(Code)
Creates empty instance whose items will not be alphabetized.



EditableProperties
public EditableProperties(boolean alphabetize)(Code)
Creates empty instance.
Parameters:
  alphabetize - alphabetize new items according to key or not



EditableProperties
public EditableProperties(Map<String, String> map)(Code)
Creates instance from an existing map. No comments will be defined. Any order from the existing map will be retained, and further additions will not be alphabetized.
Parameters:
  map - a map from String to String




Method Detail
clone
public Object clone()(Code)



cloneProperties
public EditableProperties cloneProperties()(Code)
Create an exact copy of this properties object. a clone of this object



entrySet
public Set<Map.Entry<String, String>> entrySet()(Code)
Returns a set view of the mappings ordered according to their file position. Each element in this set is a Map.Entry. See AbstractMap.entrySet for more details. set with Map.Entry instances.



getComment
public String[] getComment(String key)(Code)
Returns comment associated with the property. The comment lines are returned as defined in properties file, that is comment delimiter is included. Comment for property is defined as: continuous block of lines starting with comment delimiter which are followed by property declaration (no empty line separator allowed).
Parameters:
  key - a property name; cannot be null nor empty array of String lines as specified in properties file; commentdelimiter character is included



getProperty
public String getProperty(String key)(Code)
Convenience method to get a property as a string. Same as EditableProperties.get ; only here because of pre-generic code.
Parameters:
  key - a property name; cannot be null nor empty the property value, or null if it was not defined



load
public void load(InputStream stream) throws IOException(Code)
Load properties from a stream.
Parameters:
  stream - an input stream
throws:
  IOException - if the contents are malformed or the stream could not be read



put
public String put(String key, String value)(Code)



setComment
public void setComment(String key, String[] comment, boolean separate)(Code)
Create comment for the property.

Note: if a comment includes non-ISO-8859-1 characters, they will be written to disk using Unicode escapes (and EditableProperties.getComment will interpret such escapes), but of course they will be unreadable for humans.
Parameters:
  key - a property name; cannot be null nor empty
Parameters:
  comment - lines of comment which will be written just abovethe property; no reformatting; comment lines must start with comment delimiter; cannot be null; cannot be emty array
Parameters:
  separate - whether the comment should be separated from previousitem by empty line




setProperty
public String setProperty(String key, String value)(Code)
Convenience method to set a property. Same as EditableProperties.put ; only here because of pre-generic code.
Parameters:
  key - a property name; cannot be null nor empty
Parameters:
  value - the desired value; cannot be null previous value of the property or null if there was not any



setProperty
public String setProperty(String key, String[] value)(Code)
Sets a property to a value broken into segments for readability. Same behavior as EditableProperties.setProperty(String,String) with the difference that each item will be stored on its own line of text. EditableProperties.getProperty will simply concatenate all the items into one string, so generally separators (such as : for path-like properties) must be included in the items (for example, at the end of all but the last item).
Parameters:
  key - a property name; cannot be null nor empty
Parameters:
  value - the desired value; cannot be null; can be empty array previous value of the property or null if there was not any



store
public void store(OutputStream stream) throws IOException(Code)
Store properties to a stream.
Parameters:
  stream - an output stream
throws:
  IOException - if the stream could not be written to



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.