Java Doc for AbstractConverter.java in  » Swing-Library » jgoodies-data-binding » com » jgoodies » binding » value » 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 » Swing Library » jgoodies data binding » com.jgoodies.binding.value 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jgoodies.binding.value.AbstractValueModel
   com.jgoodies.binding.value.AbstractConverter

AbstractConverter
abstract public class AbstractConverter extends AbstractValueModel (Code)
An abstract class that minimizes the effort required to implement a type converter. A type converter is a ValueModel that converts the type of an object being held as a value in one ValueModel into another type.

More formally, a converting ValueModel VM1 converts the type T2 of an object being held as a value in one ValueModel VM2 into another type T1. When reading a value from VM1, instances of T2 are read from VM2 and are converted to T1. When storing a new value to VM1, the type converter will perform the inverse conversion and will convert an instance of T1 to T2.

The conversion must be performed when reading and writing values, as well as in the change notification. This class specifies abstract methods for the conversion from source to output, which is used to convert in #getValue and in the change notification. For the write conversion you must implement #setValue.

Most converters can set values converted by #convertFromSubject with #setValue. However, a converter may reject subject values to be converted and may reject values to be set - as any ValueModel.

Type converters should be used judiciously and only to bridge two ValueModels. Converters often use a generic but weak conversion, and so can be limited w.r.t. to localized formatting conventions.

When binding non-String values to a text UI component, consider using a javax.swing.JFormattedTextField . Formatted text fields provide a powerful means to convert strings to objects and handle many cases that arise around invalid input. Formatted text fields can be bound to ValueModels using the com.jgoodies.binding.beans.PropertyConnector class.
author:
   Karsten Lentzsch
version:
   $Revision: 1.9 $
See Also:   ValueModel
See Also:   ConverterFactory
See Also:   javax.swing.JFormattedTextField
See Also:   com.jgoodies.binding.beans.PropertyConnector



Field Summary
final protected  ValueModelsubject
     Holds the ValueModel that in turn holds the source value.

Constructor Summary
public  AbstractConverter(ValueModel subject)
     Constructs an AbstractConverter on the given subject.

Method Summary
abstract public  ObjectconvertFromSubject(Object subjectValue)
     Converts a value from the subject to the type or format used by this converter.
public  ObjectgetValue()
     Converts the subject's value and returns the converted value.
final public  voidrelease()
     Removes the internal subject value change handler from the subject. The listener has been registered during construction.

Field Detail
subject
final protected ValueModel subject(Code)
Holds the ValueModel that in turn holds the source value.




Constructor Detail
AbstractConverter
public AbstractConverter(ValueModel subject)(Code)
Constructs an AbstractConverter on the given subject.
Parameters:
  subject - the ValueModel that holds the source value
throws:
  NullPointerException - if the subject is null




Method Detail
convertFromSubject
abstract public Object convertFromSubject(Object subjectValue)(Code)
Converts a value from the subject to the type or format used by this converter.
Parameters:
  subjectValue - the subject's value the converted value in the type or format used by this converter



getValue
public Object getValue()(Code)
Converts the subject's value and returns the converted value. the converted subject value



release
final public void release()(Code)
Removes the internal subject value change handler from the subject. The listener has been registered during construction. Useful to avoid memory leaks, if the subject lives much longer than this converter. As an alternative you can use event listener lists in your ValueModels that implement references with WeakReference.

This converter must not be used anymore once #release has been called.
See Also:   WeakReference
since:
   1.3




Fields inherited from com.jgoodies.binding.value.AbstractValueModel
final public static String PROPERTYNAME_VALUE(Code)(Java Doc)

Methods inherited from com.jgoodies.binding.value.AbstractValueModel
final public void addValueChangeListener(PropertyChangeListener l)(Code)(Java Doc)
final public boolean booleanValue()(Code)(Java Doc)
final public double doubleValue()(Code)(Java Doc)
final public void fireValueChange(Object oldValue, Object newValue)(Code)(Java Doc)
final public void fireValueChange(Object oldValue, Object newValue, boolean checkIdentity)(Code)(Java Doc)
final public void fireValueChange(boolean oldValue, boolean newValue)(Code)(Java Doc)
final public void fireValueChange(int oldValue, int newValue)(Code)(Java Doc)
final public void fireValueChange(long oldValue, long newValue)(Code)(Java Doc)
final public void fireValueChange(double oldValue, double newValue)(Code)(Java Doc)
final public void fireValueChange(float oldValue, float newValue)(Code)(Java Doc)
final public float floatValue()(Code)(Java Doc)
public String getString()(Code)(Java Doc)
final public int intValue()(Code)(Java Doc)
final public long longValue()(Code)(Java Doc)
final public void removeValueChangeListener(PropertyChangeListener l)(Code)(Java Doc)
final public void setValue(boolean b)(Code)(Java Doc)
final public void setValue(double d)(Code)(Java Doc)
final public void setValue(float f)(Code)(Java Doc)
final public void setValue(int i)(Code)(Java Doc)
final public void setValue(long l)(Code)(Java Doc)
public String toString()(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.