Java Doc for JadProperties.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » installer » 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 » com.sun.midp.installer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.util.Properties
      com.sun.midp.installer.JadProperties

All known Subclasses:   com.sun.midp.jadtool.AppDescriptor,  com.sun.midp.installer.ManifestProperties,
JadProperties
public class JadProperties extends Properties (Code)
This class represents a set of properties loaded from a MIDP Java Application Descriptor. The parsing of descriptor is more relaxed than the MIDP 1.0 specification. First, the white space that is required before and after the property value is optional. Second, any extra carriage returns and end of file characters are ignored. Third, the key of the property is only checked for whitespace. Fourth, blanklines are allowed so the save code when parsing JAR manifests.

The set of properties, though not strictly ordered, will be stored in the same order it was read in or created, with modifications being appended to the end of the list by default.

If an alternate encoding type is not given, when saving properties to a stream or loading them from a stream, the ISO 8859-1 character encoding is used.



Field Summary
final protected static  intCR
     Carriage Return - Unicode character 0x0D.
final protected static  intEOF
     End Of File - Unicode character 0x1A.
final protected static  intHT
     Horizontal Tab - Unicode character 0x09.
final protected static  intLF
     Line Feed - Unicode character 0x0A.
final protected static  intSP
     SPace - Unicode character 0x20.
protected  char[]lineBuffer
     Buffers one line from the stream.

Constructor Summary
public  JadProperties()
     Constructor - creates an empty property list.

Method Summary
protected  booleancheckKeyChars(String key)
     Check to see if all the chars in the key of a property are valid.
protected  booleancheckValueChars(String value)
     Check to see if all the chars in the value of a property are valid.
public synchronized  voidload(InputStream inStream, String enc)
     Reads a JAD (key and element pairs) from the input stream. The stream uses the character encoding specified by enc

Every property occupies one line of the input stream.

public synchronized  voidload(InputStream inStream)
     Loads properties from the input stream using the default character encoding.
public  voidpartialLoad(InputStream inStream, String enc, int propertiesToLoad)
     Loads up a given number of properties from a JAD.
protected  voidputProperty(String key, String value)
     Store key:value pair.
protected  StringreadLine(Reader in)
     Reads one using a given reader.

Field Detail
CR
final protected static int CR(Code)
Carriage Return - Unicode character 0x0D.



EOF
final protected static int EOF(Code)
End Of File - Unicode character 0x1A.



HT
final protected static int HT(Code)
Horizontal Tab - Unicode character 0x09.



LF
final protected static int LF(Code)
Line Feed - Unicode character 0x0A.



SP
final protected static int SP(Code)
SPace - Unicode character 0x20.



lineBuffer
protected char[] lineBuffer(Code)
Buffers one line from the stream.




Constructor Detail
JadProperties
public JadProperties()(Code)
Constructor - creates an empty property list.




Method Detail
checkKeyChars
protected boolean checkKeyChars(String key)(Code)
Check to see if all the chars in the key of a property are valid.
Parameters:
  key - key to check false if a character is not valid for a key



checkValueChars
protected boolean checkValueChars(String value)(Code)
Check to see if all the chars in the value of a property are valid.
Parameters:
  value - value to check false if a character is not valid for a value



load
public synchronized void load(InputStream inStream, String enc) throws IOException, InvalidJadException(Code)
Reads a JAD (key and element pairs) from the input stream. The stream uses the character encoding specified by enc

Every property occupies one line of the input stream. Each line is terminated by a line terminator which can be a LF, or (CR LF). Lines from the input stream are processed until end of file is reached on the input stream.

Every line describes one property to be added to the table. The key consists of all the characters from beginning of the line up to, but not including the first ASCII :. All remaining characters on the line become part of the associated element. The element is also trimmed of leading and trailing whitespace.

As an example, each of the following line specifies the key "Truth" and the associated element value "Beauty":

 Truth: Beauty
 

This method will try to continue after a format error and load as many properties it can, but throw the last error encountered.
Parameters:
  inStream - the input stream.
Parameters:
  enc - character encoding used on input stream,can be null to get the default (UTF-8)
exception:
  IOException - if an error occurred when reading from theinput stream.
exception:
  InvalidJadException - if the JAD is not formatted correctly.




load
public synchronized void load(InputStream inStream) throws IOException, InvalidJadException(Code)
Loads properties from the input stream using the default character encoding. Currently the default encoding is UTF8.
See Also:   JadProperties.load(InputStream inStream,String enc)
Parameters:
  inStream - the input stream.
exception:
  IOException - if an error occurred when reading from theinput stream.
exception:
  InvalidJadException - if the JAD is not formatted correctly.



partialLoad
public void partialLoad(InputStream inStream, String enc, int propertiesToLoad) throws IOException, InvalidJadException(Code)
Loads up a given number of properties from a JAD. Used when authenticating a JAD.
Parameters:
  inStream - the input stream.
Parameters:
  enc - character encoding used on input stream,null for the default encoding (UTF-8)
Parameters:
  propertiesToLoad - maximum number of properties to load
exception:
  IOException - if an error occurred when reading from theinput stream.
exception:
  InvalidJadException - if the JAD is not formatted correctly.



putProperty
protected void putProperty(String key, String value)(Code)
Store key:value pair.
Parameters:
  key - the key to be placed into this property list.
Parameters:
  value - the value corresponding to key.
See Also:   JadProperties.getProperty



readLine
protected String readLine(Reader in) throws IOException(Code)
Reads one using a given reader. LF or CR LF end a line. The end of line and end of file characters are dropped.
Parameters:
  in - reader for a JAD one line of the JAD or null at the end of the JAD
exception:
  IOException - thrown by the reader



Methods inherited from com.sun.midp.util.Properties
public synchronized void addProperty(String key, String value)(Code)(Java Doc)
public String getKeyAt(int index)(Code)(Java Doc)
public String getProperty(String key)(Code)(Java Doc)
public String getPropertyIgnoreCase(String key)(Code)(Java Doc)
public String getValueAt(int index)(Code)(Java Doc)
public synchronized String removeProperty(String key)(Code)(Java Doc)
public synchronized String setProperty(String key, String value)(Code)(Java Doc)
public synchronized String setPropertyAt(int index, String value)(Code)(Java Doc)
public synchronized String setPropertyIgnoreCase(String key, String value)(Code)(Java Doc)
public int size()(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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