Java Doc for Value.java in  » 6.0-JDK-Modules » jsr-283 » javax » jcr » 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 » jsr 283 » javax.jcr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.jcr.Value

Value
public interface Value (Code)
A generic holder for the value of a property. A Value object can be used without knowing the actual property type (STRING, DOUBLE, BINARY etc.).

Any implementation of this interface must adhere to the following behavior:

  • A Value object can be read using type-specific get methods. These methods are divided into two groups:
    • The non-stream get methods getString(), getBinary(), getDate(), getDecimal(), getLong(), getDouble() and getBoolean().
    • getStream().
  • Once a Value object has been read once using getStream(), all subsequent calls to getStream() will return the same Stream object. This may mean, for example, that the stream returned is fully or partially consumed. In order to get a fresh stream the Value object must be reacquired via Property.getValue or Property.getValues .
  • Once a Value object has been read once using getStream(), any subsequent call to any of the non-stream get methods will throw an IllegalStateException. In order to successfully invoke a non-stream get method, the Value must be reacquired via Property.getValue or Property.getValues .
  • Once a Value object has been read once using a non-stream get method, any subsequent call to getStream() will throw an IllegalStateException. In order to successfully invoke getStream(), the Value must be reacquired via Property.getValue or Property.getValues .

Two Value instances, v1 and v2, are considered equal if and only if:

  • v1.getType() == v2.getType(), and,
  • v1.getString().equals(v2.getString())
Actually comparing two Value instances by converting them to string form may not be practical in some cases (for example, if the values are very large binaries). Consequently, the above is intended as a normative definition of Value equality but not as a procedural test of equality. It is assumed that implementations will have efficient means of determining equality that conform with the above definition. An implementation is only required to support equality comparisons on Value instances that were acquired from the same Session and whose contents have not been read. The equality comparison must not change the state of the Value instances even though the getString() method in the above definition implies a state change.




Method Summary
public  BinarygetBinary()
     Returns a Binary representation of this value.
public  booleangetBoolean()
     Returns a Boolean representation of this value.
public  CalendargetDate()
     Returns a Calendar representation of this value.
public  BigDecimalgetDecimal()
     Returns a BigDecimal representation of this value.
public  doublegetDouble()
     Returns a double representation of this value.
public  longgetLong()
     Returns a long representation of this value.
public  InputStreamgetStream()
     Returns an InputStream representation of this value.
public  StringgetString()
     Returns a String representation of this value.
public  intgetType()
     Returns the type of this Value.



Method Detail
getBinary
public Binary getBinary() throws RepositoryException(Code)
Returns a Binary representation of this value. The Binary object in turn provides methods to access the binary data itself. Uses the standard conversion to binary (see JCR specification). A Binary representation of this value.
throws:
  RepositoryException - if an error occurs.
since:
   JCR 2.0



getBoolean
public boolean getBoolean() throws ValueFormatException, IllegalStateException, RepositoryException(Code)
Returns a Boolean representation of this value.

If this value cannot be converted to a Boolean, a ValueFormatException is thrown.

If getStream has previously been called on this Value instance, an IllegalStateException is thrown. In this case a new Value instance must be acquired in order to successfully call getBoolean.

A RepositoryException is thrown if another error occurs. A Boolean representation of this value.
throws:
  ValueFormatException - if conversion to a Boolean is not possible.
throws:
  IllegalStateException - if getStream has previouslybeen called on this Value instance.
throws:
  RepositoryException - if another error occurs.




getDate
public Calendar getDate() throws ValueFormatException, IllegalStateException, RepositoryException(Code)
Returns a Calendar representation of this value.

The object returned is a copy of the stored value, so changes to it are not reflected in internal storage.

If this value cannot be converted to a Calendar, a ValueFormatException is thrown.

If getStream has previously been called on this Value instance, an IllegalStateException is thrown. In this case a new Value instance must be acquired in order to successfully call getDate.

A RepositoryException is thrown if another error occurs. A Calendar representation of this value.
throws:
  ValueFormatException - if conversion to a Calendar is not possible.
throws:
  IllegalStateException - if getStream has previouslybeen called on this Value instance.
throws:
  RepositoryException - if another error occurs.




getDecimal
public BigDecimal getDecimal() throws ValueFormatException, IllegalStateException, RepositoryException(Code)
Returns a BigDecimal representation of this value.

If this value cannot be converted to a BigDecimal, a ValueFormatException is thrown.

If getStream has previously been called on this Value instance, an IllegalStateException is thrown. In this case a new Value instance must be acquired in order to successfully call getDouble.

A RepositoryException is thrown if another error occurs. A BigDecimal representation of this value.
throws:
  ValueFormatException - if conversion to a BigDecimal is not possible.
throws:
  IllegalStateException - if getStream has previouslybeen called on this Value instance.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




getDouble
public double getDouble() throws ValueFormatException, IllegalStateException, RepositoryException(Code)
Returns a double representation of this value.

If this value cannot be converted to a double, a ValueFormatException is thrown.

If getStream has previously been called on this Value instance, an IllegalStateException is thrown. In this case a new Value instance must be acquired in order to successfully call getDouble.

A RepositoryException is thrown if another error occurs. A double representation of this value.
throws:
  ValueFormatException - if conversion to a double is not possible.
throws:
  IllegalStateException - if getStream has previouslybeen called on this Value instance.
throws:
  RepositoryException - if another error occurs.




getLong
public long getLong() throws ValueFormatException, IllegalStateException, RepositoryException(Code)
Returns a long representation of this value.

If this value cannot be converted to a long, a ValueFormatException is thrown.

If getStream has previously been called on this Value instance, an IllegalStateException is thrown. In this case a new Value instance must be acquired in order to successfully call getLong.

A RepositoryException is thrown if another error occurs. A long representation of this value.
throws:
  ValueFormatException - if conversion to an long is not possible.
throws:
  IllegalStateException - if getStream has previouslybeen called on this Value instance.
throws:
  RepositoryException - if another error occurs.




getStream
public InputStream getStream() throws IllegalStateException, RepositoryException(Code)
Returns an InputStream representation of this value. Uses the standard conversion to binary (see JCR specification).

It is the responsibility of the caller to close the returned InputStream.

If a non-stream get method has previously been called on this Value instance, an IllegalStateException is thrown. In this case a new Value instance must be acquired in order to successfully call getStream.

A RepositoryException is thrown if another error occurs. Value.getBinary() An InputStream representation of this value.
throws:
  IllegalStateException - if a non-stream get method has previouslybeen called on this Value instance.
throws:
  RepositoryException - if another error occurs.




getString
public String getString() throws ValueFormatException, IllegalStateException, RepositoryException(Code)
Returns a String representation of this value.

If this value cannot be converted to a string, a ValueFormatException is thrown.

If getStream has previously been called on this Value instance, an IllegalStateException is thrown. In this case a new Value instance must be acquired in order to successfully call getString.

A RepositoryException is thrown if another error occurs. A String representation of the value of this property.
throws:
  ValueFormatException - if conversion to a String is not possible.
throws:
  IllegalStateException - if getStream has previouslybeen called on this Value instance.
throws:
  RepositoryException - if another error occurs.




getType
public int getType()(Code)
Returns the type of this Value. One of:
  • PropertyType.STRING
  • PropertyType.DATE
  • PropertyType.BINARY
  • PropertyType.DOUBLE
  • PropertyType.LONG
  • PropertyType.BOOLEAN
  • PropertyType.NAME
  • PropertyType.PATH
  • PropertyType.REFERENCE
  • PropertyType.WEAKREFERENCE
  • PropertyType.URI
See PropertyType .

The type returned is that which was set at property creation.




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