Java Doc for FieldValue.java in  » Database-ORM » MMBase » org » mmbase » bridge » 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 » Database ORM » MMBase » org.mmbase.bridge 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.mmbase.bridge.FieldValue

All known Subclasses:   org.mmbase.bridge.implementation.BasicFieldValue,  org.mmbase.bridge.util.AbstractFieldValue,
FieldValue
public interface FieldValue (Code)
This interface represents a value stored in a node.
author:
   Pierre van Rooden
since:
   MMBase 1.6
version:
   $Id: FieldValue.java,v 1.12 2007/02/16 20:04:39 michiel Exp $




Method Summary
public  booleancanModify()
     Returns whether this value can be changed.
public  Objectget()
     Returns the value as an Object. The object type may vary and is dependent on how data was stored in a field. I.e.
public  FieldgetField()
     Returns the Field object belonging to this value. the field object.
public  NodegetNode()
     Returns the Node to which this value belongs.
public  booleanisNull()
    
public  voidset(Object value)
     Sets the value, passing any Object The object type may vary and is generally stored in memory as-is, which means that, generally, the get() method returns the same object. Note that for an XML field String values are converted to a XML document, and individual builders may make their own changes. The object is converted to the actual type (using the getXXX() methods detailed above) once the node is stored, though that does not affect the data in-memory until the Node is read anew from the storage. Note that this behavior may change in the future and therefor code should not be dependent on this. By preference, use the more specific methods for setting data (i.e.
public  voidsetBoolean(boolean value)
     Sets the value, passing a boolean value.
public  voidsetByte(byte[] value)
     Sets the value, passing a byte array.
public  voidsetDate(java.util.Date value)
     Sets the value, passing a java.util.Date object.
public  voidsetDouble(double value)
     Sets the value, passing a double value.
public  voidsetFLoat(float value)
     Sets the value, passing a float value.
public  voidsetInt(int value)
     Sets the value, passing a int value.
public  voidsetLong(long value)
     Sets the value, passing a long value.
public  voidsetNode(Node value)
     Sets the value, passing a Node.
public  voidsetObject(Object value)
    
public  voidsetString(String value)
     Sets the value, passing a String.
public  voidsetXML(org.w3c.dom.Document value)
     Sets the value, passing a org.w3c.dom.Document object.
public  booleantoBoolean()
     Returns the value as an boolean (true or false). If the actual value is a Boolean object, this call returns it's (primitive) boolean value. If the actual value is a Number object, this call returns true if the value is a positive, non-zero, value.
public  byte[]toByte()
     Returns the value as a byte array. This function returns either the value of a byte field, or the byte value of a string (converted using the default encoding, i.e.
public  java.util.DatetoDate()
    
public  doubletoDouble()
     Returns the value as a double. This function attempts to convert the value to a double. Numeric fields are simply converted.
public  floattoFloat()
     Returns the value as a float. This function attempts to convert the value to a float. Numeric fields are simply converted. Boolean fields return 0.0 if false, and 1.0 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e.
public  inttoInt()
     Returns the value as an int. This function attempts to convert the value to an int. Numeric fields are simply converted.
public  longtoLong()
     Returns the value as a long. This function attempts to convert the value to a long. Numeric fields are simply converted.
public  NodetoNode()
     Returns the value as a Node.
public  StringtoString()
     Returns the value as a String.
public  org.w3c.dom.DocumenttoXML()
     Returns the value as a org.w3c.dom.Document If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML.
public  org.w3c.dom.ElementtoXML(org.w3c.dom.Document tree)
     Returns the value as a org.w3c.dom.Element If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML.



Method Detail
canModify
public boolean canModify()(Code)
Returns whether this value can be changed. Some field values (such as the values of the number, owner, and otype fields) cannot be changed through this interface (but some may be changed through other means). true if the value can be changed



get
public Object get()(Code)
Returns the value as an Object. The object type may vary and is dependent on how data was stored in a field. I.e. It may be possible for an Integer field to return it's value as a String if it was stored that way in the first place. the field value as an object



getField
public Field getField()(Code)
Returns the Field object belonging to this value. the field object. Why not return Field?



getNode
public Node getNode()(Code)
Returns the Node to which this value belongs. the Node object



isNull
public boolean isNull()(Code)



set
public void set(Object value)(Code)
Sets the value, passing any Object The object type may vary and is generally stored in memory as-is, which means that, generally, the get() method returns the same object. Note that for an XML field String values are converted to a XML document, and individual builders may make their own changes. The object is converted to the actual type (using the getXXX() methods detailed above) once the node is stored, though that does not affect the data in-memory until the Node is read anew from the storage. Note that this behavior may change in the future and therefor code should not be dependent on this. By preference, use the more specific methods for setting data (i.e. setString()).
See Also:   FieldValue.get
Parameters:
  value - the field value as an Object



setBoolean
public void setBoolean(boolean value)(Code)
Sets the value, passing a boolean value. This value is converted to a Boolean object.
See Also:   FieldValue.toBoolean
Parameters:
  value - the field value as a boolean



setByte
public void setByte(byte[] value)(Code)
Sets the value, passing a byte array.
See Also:   FieldValue.toByte
Parameters:
  value - the field value as a byte array



setDate
public void setDate(java.util.Date value)(Code)
Sets the value, passing a java.util.Date object.
See Also:   FieldValue.toDate
Parameters:
  value - the field value as a java.util.Date Document
since:
   MMBase-1.8



setDouble
public void setDouble(double value)(Code)
Sets the value, passing a double value. This value is converted to a Double object.
See Also:   FieldValue.toDouble
Parameters:
  value - the field value as a double



setFLoat
public void setFLoat(float value)(Code)
Sets the value, passing a float value. This value is converted to a Float object.
See Also:   FieldValue.toFloat
Parameters:
  value - the field value as a float



setInt
public void setInt(int value)(Code)
Sets the value, passing a int value. This value is converted to a Integer object.
See Also:   FieldValue.toInt
Parameters:
  value - the field value as a int



setLong
public void setLong(long value)(Code)
Sets the value, passing a long value. This value is converted to a Long object.
See Also:   FieldValue.toLong
Parameters:
  value - the field value as a long



setNode
public void setNode(Node value)(Code)
Sets the value, passing a Node.
See Also:   FieldValue.toNode
Parameters:
  value - the field value as a Node



setObject
public void setObject(Object value)(Code)



setString
public void setString(String value)(Code)
Sets the value, passing a String.
See Also:   FieldValue.toString
Parameters:
  value - the field value as a String



setXML
public void setXML(org.w3c.dom.Document value)(Code)
Sets the value, passing a org.w3c.dom.Document object.
See Also:   FieldValue.toXML(org.w3c.dom.Document)
Parameters:
  value - the field value as a XML Document



toBoolean
public boolean toBoolean()(Code)
Returns the value as an boolean (true or false). If the actual value is a Boolean object, this call returns it's (primitive) boolean value. If the actual value is a Number object, this call returns true if the value is a positive, non-zero, value. In other words, values '0' and '-1' are concidered false. If the value is a string, this call returns true if the value is "true" or "yes" (case-insensitive). In all other cases (including calling byte fields), false is returned. the field value as a boolean



toByte
public byte[] toByte()(Code)
Returns the value as a byte array. This function returns either the value of a byte field, or the byte value of a string (converted using the default encoding, i.e. UTF8) Other types of values return an empty byte-array. the field value as a byte array



toDate
public java.util.Date toDate()(Code)
Returns the value as a java.util.Date If the value cannot be converted, this method returns null the field value as Date
since:
   MMBase-1.8



toDouble
public double toDouble()(Code)
Returns the value as a double. This function attempts to convert the value to a double. Numeric fields are simply converted. Double may be truncated. Boolean fields return 0.0 if false, and 1.0 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1.0. the field value as a double



toFloat
public float toFloat()(Code)
Returns the value as a float. This function attempts to convert the value to a float. Numeric fields are simply converted. Boolean fields return 0.0 if false, and 1.0 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1.0. the field value as a float



toInt
public int toInt()(Code)
Returns the value as an int. This function attempts to convert the value to an int. Numeric fields are simply converted. Double and float values may be truncated. For Node values, the numeric key is returned. Long values return -1 of the value is too large. Boolean fields return 0 if false, and 1 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1 the field value as an int.



toLong
public long toLong()(Code)
Returns the value as a long. This function attempts to convert the value to a long. Numeric fields are simply converted. Double and float values may be truncated. Boolean fields return 0 if false, and 1 if true. String fields are parsed. If a parsed string contains an error, ot the field value is not of a type that can be converted (i.e. a byte array), this function returns -1 the field value as a long.



toNode
public Node toNode()(Code)
Returns the value as a Node. This function attempts to retrieve the node represented by the value. For numeric fields the node is retrieved using the numeric values as the node key. String fields are used as Node aliases, withw hich to retrieve the Node. If the node does not exist, or the value is of anotehr type, the function returns null. the field value as a Node



toString
public String toString()(Code)
Returns the value as a String. Byte arrays are converted to string using the default encoding (UTF8). Node values return a string representation of their numeric key. DOM Documents are serialized to a proper strign represnattion fo the xml. For other values the result is calling the toString() method on the actual object. the field value as a String



toXML
public org.w3c.dom.Document toXML() throws IllegalArgumentException(Code)
Returns the value as a org.w3c.dom.Document If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML. If the value cannot be converted, this method returns null the field value as a Document
throws:
  IllegalArgumentException - if the Field is not of type TYPE_XML.



toXML
public org.w3c.dom.Element toXML(org.w3c.dom.Document tree) throws IllegalArgumentException(Code)
Returns the value as a org.w3c.dom.Element If the node value is not itself a Document, the method attempts to attempts to convert the String value into an XML. This method fails (throws a IllegalArgumentException) if the Field is not of type TYPE_XML. If the value cannot be converted, this method returns null
Parameters:
  tree - the DOM Document to which the Element is added(as the document root element) the field value as an Element
throws:
  IllegalArgumentException - if the Field is not of type TYPE_XML.



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