Java Doc for DefaultDataField.java in  » J2EE » Expresso » com » jcorporate » expresso » core » dataobjects » 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 » J2EE » Expresso » com.jcorporate.expresso.core.dataobjects 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jcorporate.expresso.core.dataobjects.DefaultDataField

DefaultDataField
public class DefaultDataField implements DataField,Serializable(Code)
Default implementation of the DataField interface. This class provides some basic conversion capabilities between different Java types as well as provides all use change logging capabilities.
author:
   Michael Rimov
since:
   Expresso 5.0


Field Summary
final public static  StringATTRIBUTE_ERROR
     Attribute String for if there's an error with the field.
final public static  StringATTRIBUTE_ERROR_MESSAGE
     Attribute String for what message to display if there's an error with thie field.
protected  Mapattributes
    
protected  ObjectcurrentValue
    
protected  booleanisChanged
    
protected  booleanisValueSet
    
protected transient  DataFieldMetaDatamyMetaData
     A link to my metadata.
protected  ObjectoriginalValue
    
protected transient  DataObjectowner
     A link to the DataObject that contains me.

Constructor Summary
protected  DefaultDataField(DataFieldMetaData metaData, DataObject parentObject)
     Creates a new DefaultDataField object.

Method Summary
public  BigDecimalasBigDecimal()
     Retrieve the wrapped object as a BigDecimal object or zero if we're unable to convert it.
public  BooleanasBoolean()
     Retrieve the boolean object value. Boolean object.
public  DateasDate()
     Retrieve the wrapped object as a Date object or possibly null if we can't convert it or the object is null.
public  DoubleasDouble()
    
public  IntegerasInteger()
     Retrieves the wrapped object as an Integer or zero if it's an invalid format.
public  InputStreamasStream()
     Retrieve the field as a InputStream.
public  StringasString()
    
public  voidcacheIsChangedComparison()
    
public  voidcheckValue()
     Make sure the value of the field is valid.
public  MapgetAllAttributes()
     Returns a Read Only Map of all attributes in name-value pairs.
public  ObjectgetAttribute(String attributeName)
     Retrieves any user defined attributes for this field.
protected  StringgetBooleanFieldValue(Boolean theFieldValue)
     Internal refactoring for getting what a boolean field should be set to.
public  DataFieldMetaDatagetFieldMetaData()
     Returns a handle to the Field MetaData object.
public static  DefaultDataFieldgetInstance(DataFieldMetaData metaData, DataObject parentObject)
    
public  ObjectgetOriginalValue()
     Retrieve the last original value if the data has changed.
public  DataObjectgetOwner()
    
protected  PatternMatchergetPatternMatcher()
     Retrieve a thread local instance of the Perl5 pattern matcher.
public  ObjectgetSerializedForm()
     Returns the form in a way suitable for storage in a database or other data source.
protected  SimpleDateFormatgetSimpleDateFormat(String pattern)
     Get a SimpleDateFormat object that is cached.
public  ObjectgetValue()
    
public  booleanisChanged()
     Used for change logging and updating only changed fields. change is true IF the field has been set once (after object is born or reset), and subsequently the value is changed in the field. true if the field has changed since the last reset (i.e.
public  booleanisNull()
     Returns true if the object is null.
public  booleanisValueSet()
     Used for change logging.
public  voidrelease()
    
public  voidremoveAttribute(String attribute)
    
public  voidresetChanged()
    
public  voidsetAttribute(String attributeName, Object value)
    
public  voidsetFieldMetaData(DataFieldMetaData newMetadata)
     Sets the metadata object for this field.
Parameters:
  newMetadata - the new Field Meta data object...
public  voidsetOwner(DataObject newOwner)
    
public  voidsetSerializedForm(Object o)
     Used for setting raw data from a JDBC connection.
public  voidsetValue(Object newValue)
    

Field Detail
ATTRIBUTE_ERROR
final public static String ATTRIBUTE_ERROR(Code)
Attribute String for if there's an error with the field.



ATTRIBUTE_ERROR_MESSAGE
final public static String ATTRIBUTE_ERROR_MESSAGE(Code)
Attribute String for what message to display if there's an error with thie field.



attributes
protected Map attributes(Code)
A generic map of attribute keys to attribute values



currentValue
protected Object currentValue(Code)
The Current Value



isChanged
protected boolean isChanged(Code)
Flag to signify if the field is changed



isValueSet
protected boolean isValueSet(Code)
Flag to signify if the field value has been set - the retrieved value may be null



myMetaData
protected transient DataFieldMetaData myMetaData(Code)
A link to my metadata.



originalValue
protected Object originalValue(Code)
The original value, used in comparison tests for 'isChanged' calculation; set by first retrieve(); reset after add() or update()



owner
protected transient DataObject owner(Code)
A link to the DataObject that contains me.




Constructor Detail
DefaultDataField
protected DefaultDataField(DataFieldMetaData metaData, DataObject parentObject)(Code)
Creates a new DefaultDataField object.
Parameters:
  metaData -
Parameters:
  parentObject -




Method Detail
asBigDecimal
public BigDecimal asBigDecimal()(Code)
Retrieve the wrapped object as a BigDecimal object or zero if we're unable to convert it. a properly instantiated BigDecimal Object if we're able to convert it.



asBoolean
public Boolean asBoolean()(Code)
Retrieve the boolean object value. Boolean object. Null if the object's value is null



asDate
public Date asDate()(Code)
Retrieve the wrapped object as a Date object or possibly null if we can't convert it or the object is null. a properly instantiated Date Object if we're able to convert it.



asDouble
public Double asDouble()(Code)
Retrieve the wrapped object as a Double object or zero if we can't convert i a properly instantiated Double Object if we're able to convert it.



asInteger
public Integer asInteger()(Code)
Retrieves the wrapped object as an Integer or zero if it's an invalid format. a java.lang.Integer object, or null if the object is null.



asStream
public InputStream asStream()(Code)
Retrieve the field as a InputStream. If the object's native type is an input stream, it returns that. If it is a serializable object, it returns a ByteArrayInputStream that was created using a ByteArrayOutputStream as well as a ObjectOutputStream. java.io.InputSTream or null if there was an IO Exception gettingthe value, the value was null, of if the native object is not serializable



asString
public String asString()(Code)
Retrieves the wrapped object as a String a String value representing the object as a string



cacheIsChangedComparison
public void cacheIsChangedComparison()(Code)
reset 'original' value and isChanged flags; call when add(), retrieve() or update() has occurred, and currentValue of data fields should be considered 'original value' for purposes of determining 'isChanged'



checkValue
public void checkValue() throws DataException(Code)
Make sure the value of the field is valid. Checks mask and for null.
throws:
  DataException - if the field value is not valid



getAllAttributes
public Map getAllAttributes()(Code)
Returns a Read Only Map of all attributes in name-value pairs. If there are no attributes then getAllAttributes will return a null map. java.util.map



getAttribute
public Object getAttribute(String attributeName)(Code)
Retrieves any user defined attributes for this field.
Parameters:
  attributeName - the name of the attribute to retrieve an object or null if the attribute doesn't exist



getBooleanFieldValue
protected String getBooleanFieldValue(Boolean theFieldValue)(Code)
Internal refactoring for getting what a boolean field should be set to.
Parameters:
  theFieldValue - The target value the string value
throws:
  IllegalArgumentException - If we can't get the data context



getFieldMetaData
public DataFieldMetaData getFieldMetaData()(Code)
Returns a handle to the Field MetaData object. DataFieldMetaData



getInstance
public static DefaultDataField getInstance(DataFieldMetaData metaData, DataObject parentObject)(Code)
create new object for this field
Parameters:
  metaData -
Parameters:
  parentObject - new instance of this field



getOriginalValue
public Object getOriginalValue()(Code)
Retrieve the last original value if the data has changed. Will return null if isChanged() is false the original object or null



getOwner
public DataObject getOwner()(Code)
Returns a handle to the DataObject that is the container for this Data Field DataObject the containing data object.



getPatternMatcher
protected PatternMatcher getPatternMatcher()(Code)
Retrieve a thread local instance of the Perl5 pattern matcher. Allows for optimization of # of instances of pattern matcher vs synchronization. PatternMatcher



getSerializedForm
public Object getSerializedForm() throws DataException(Code)
Returns the form in a way suitable for storage in a database or other data source. java.lang.Object
throws:
  DataException - upon error



getSimpleDateFormat
protected SimpleDateFormat getSimpleDateFormat(String pattern)(Code)
Get a SimpleDateFormat object that is cached. Make sure you have dateConvertFormatMap already locked before calling this function or you'll have a race condition.
Parameters:
  pattern - the format pattern to look up an instantiated SimpleDateFormat object. SimpleDateFormat is NOTthreadsafe, so make sure you do your parsing while still in the synchronizedblock. Perhaps in the future a keyed Object pool will be better.



getValue
public Object getValue()(Code)
retrieve value object for this field Object which contains value



isChanged
public boolean isChanged()(Code)
Used for change logging and updating only changed fields. change is true IF the field has been set once (after object is born or reset), and subsequently the value is changed in the field. true if the field has changed since the last reset (i.e. since object was constructed or reset)



isNull
public boolean isNull()(Code)
Returns true if the object is null. true if the object is null



isValueSet
public boolean isValueSet()(Code)
Used for change logging. true if the field has had the value set since the last reset



release
public void release()(Code)
set all internal data members to null;



removeAttribute
public void removeAttribute(String attribute)(Code)
Removes an attribute
Parameters:
  attribute - The attribute key to remove



resetChanged
public void resetChanged()(Code)
Resets the isChanged and isValueSet flags and sets the original value field to null



setAttribute
public void setAttribute(String attributeName, Object value)(Code)
Sets an attribute for this particular instance of the Data field
Parameters:
  attributeName - the name of the attribute to set
Parameters:
  value - the value to set it to



setFieldMetaData
public void setFieldMetaData(DataFieldMetaData newMetadata)(Code)
Sets the metadata object for this field.
Parameters:
  newMetadata - the new Field Meta data object... for example DBField



setOwner
public void setOwner(DataObject newOwner)(Code)
Sets the owner of a given DataObject
Parameters:
  newOwner - The new parent object.



setSerializedForm
public void setSerializedForm(Object o)(Code)
Used for setting raw data from a JDBC connection. Allows for special processing such as decryption.
Parameters:
  o - the object to set.



setValue
public void setValue(Object newValue)(Code)
Sets the wrapped object for the data field; also updates values for isValueSet and isChanged flags
Parameters:
  newValue - a new Object to set the value to



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.