Java Doc for StringConversion.java in  » XML » jibx-1.1.5 » org » jibx » binding » def » 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 » XML » jibx 1.1.5 » org.jibx.binding.def 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jibx.binding.def.StringConversion

All known Subclasses:   org.jibx.binding.def.PrimitiveStringConversion,  org.jibx.binding.def.ObjectStringConversion,
StringConversion
abstract public class StringConversion (Code)
String conversion handling. Defines serialization handling for converting to and from a String value. This uses an inheritance approach, where each serialization definition is initialized based on the handling set for the containing definition of the same (or parent class) type.
author:
   Dennis M. Sosnoski
version:
   1.0


Field Summary
final protected static  StringCOMPARE_OBJECTS_METHOD
    
final protected static  StringCOMPARE_OBJECTS_SIGNATURE
    
final protected static  String[]DESERIALIZER_SIGNATURES
    
final protected static  StringMARSHAL_ATTRIBUTE
    
final protected static  StringMARSHAL_ELEMENT
    
final public static  intMARSHAL_NAME_VALUES
    
final protected static  StringMARSHAL_SIGNATURE
    
final protected static  StringUNMARSHAL_OPT_ATTRIBUTE
    
final protected static  StringUNMARSHAL_OPT_ELEMENT
    
final protected static  StringUNMARSHAL_OPT_SIGNATURE
    
final protected static  StringUNMARSHAL_REQ_ATTRIBUTE
    
final protected static  StringUNMARSHAL_REQ_ELEMENT
    
final protected static  StringUNMARSHAL_REQ_SIGNATURE
    
protected  Objectm_default
     Default value used for this type (wrapper for primitives, otherwise String or null).
protected  ClassItemm_deserializer
     Deserializer method information.
protected  ClassItemm_serializer
     Serializer method information.
protected  Stringm_typeName
     Fully qualified name of class handled by conversion.
protected  Stringm_typeSignature
     Signature of class handled by conversion.

Constructor Summary
protected  StringConversion(String type, StringConversion inherit)
     Constructor.
 StringConversion(Object dflt, String ser, String deser, String type)
     Constructor.

Method Summary
abstract protected  ObjectconvertDefault(String text)
     Convert text representation into default value object.
abstract public  StringConversionderive(String type, String ser, String dser, String dflt)
     Derive from existing formatting information.
abstract public  voidgenFromText(ContextMethodBuilder mb)
     Generate code to convert String representation.
abstract public  voidgenParseOptional(boolean attr, ContextMethodBuilder mb)
     Generate code to parse and convert optional attribute or element.
abstract public  voidgenParseRequired(boolean attr, ContextMethodBuilder mb)
     Generate code to parse and convert required attribute or element.
public  voidgenPopValues(int count, ContextMethodBuilder mb)
     Generate code to pop values from stack.
abstract protected  BranchWrappergenToOptionalText(String type, ContextMethodBuilder mb, int extra)
     Generate code to check if an optional value is not equal to the default. This abstract base class method must be implemented by every subclass. The code generated by this method assumes that the actual value to be converted has already been pushed on the stack.
public  voidgenToText(String type, ContextMethodBuilder mb)
     Generate code to convert value to a String.
public  voidgenWriteOptional(boolean attr, String type, ContextMethodBuilder mb)
     Generate code to convert and write optional value to generated document. The generated code first tests if the value is the same as the supplied default, and if so skips writing.
public  voidgenWriteRequired(boolean attr, String type, ContextMethodBuilder mb)
     Generate code to convert and write required value to generated document. The code generated by this method assumes that the marshalling context, the name information, and the actual value to be converted have already been pushed on the stack.
public  voidgenWriteText(boolean attr, ContextMethodBuilder mb)
     Generate code to write String value to generated document. The code generated by this method assumes that the marshalling context, the name information, and the actual value to be converted have already been pushed on the stack.
public  StringgetTypeName()
     Get name of type handled by this conversion.
abstract public  booleanisPrimitive()
     Check if the type handled by this conversion is of a primitive type.
protected  voidsetDeserializer(String deser)
     Set deserializer for conversion.
protected  voidsetSerializer(String ser)
     Set serializer for conversion.

Field Detail
COMPARE_OBJECTS_METHOD
final protected static String COMPARE_OBJECTS_METHOD(Code)



COMPARE_OBJECTS_SIGNATURE
final protected static String COMPARE_OBJECTS_SIGNATURE(Code)



DESERIALIZER_SIGNATURES
final protected static String[] DESERIALIZER_SIGNATURES(Code)



MARSHAL_ATTRIBUTE
final protected static String MARSHAL_ATTRIBUTE(Code)



MARSHAL_ELEMENT
final protected static String MARSHAL_ELEMENT(Code)



MARSHAL_NAME_VALUES
final public static int MARSHAL_NAME_VALUES(Code)



MARSHAL_SIGNATURE
final protected static String MARSHAL_SIGNATURE(Code)



UNMARSHAL_OPT_ATTRIBUTE
final protected static String UNMARSHAL_OPT_ATTRIBUTE(Code)



UNMARSHAL_OPT_ELEMENT
final protected static String UNMARSHAL_OPT_ELEMENT(Code)



UNMARSHAL_OPT_SIGNATURE
final protected static String UNMARSHAL_OPT_SIGNATURE(Code)



UNMARSHAL_REQ_ATTRIBUTE
final protected static String UNMARSHAL_REQ_ATTRIBUTE(Code)



UNMARSHAL_REQ_ELEMENT
final protected static String UNMARSHAL_REQ_ELEMENT(Code)



UNMARSHAL_REQ_SIGNATURE
final protected static String UNMARSHAL_REQ_SIGNATURE(Code)



m_default
protected Object m_default(Code)
Default value used for this type (wrapper for primitives, otherwise String or null).



m_deserializer
protected ClassItem m_deserializer(Code)
Deserializer method information.



m_serializer
protected ClassItem m_serializer(Code)
Serializer method information.



m_typeName
protected String m_typeName(Code)
Fully qualified name of class handled by conversion.



m_typeSignature
protected String m_typeSignature(Code)
Signature of class handled by conversion.




Constructor Detail
StringConversion
protected StringConversion(String type, StringConversion inherit)(Code)
Constructor. Initializes conversion handling based on the supplied inherited handling.
Parameters:
  type - fully qualified name of class handled by conversion
Parameters:
  inherit - conversion information inherited by this conversion



StringConversion
StringConversion(Object dflt, String ser, String deser, String type)(Code)
Constructor. Initializes conversion handling based on argument values. This form is only used for constructing the default set of conversions. Because of this, it throws an unchecked exception on error.
Parameters:
  dflt - default value object (wrapped value for primitive types,otherwise String)
Parameters:
  ser - fully qualified name of serialization method
Parameters:
  deser - fully qualified name of deserialization method
Parameters:
  type - fully qualified name of class handled by conversion




Method Detail
convertDefault
abstract protected Object convertDefault(String text) throws JiBXException(Code)
Convert text representation into default value object. Each subclass must implement this with the appropriate conversion handling.
Parameters:
  text - value representation to be converted converted default value object
throws:
  JiBXException - on conversion error



derive
abstract public StringConversion derive(String type, String ser, String dser, String dflt) throws JiBXException(Code)
Derive from existing formatting information. This abstract base class method must be implemented by every subclass. It allows constructing a new instance from an existing format of the same or an ancestor type, with the properties of the existing format copied to the new instance except where overridden by the supplied values.
Parameters:
  type - fully qualified name of class handled by conversion
Parameters:
  ser - fully qualified name of serialization method(null if inherited)
Parameters:
  dser - fully qualified name of deserialization method(null if inherited)
Parameters:
  dflt - default value text (null if inherited) new instance initialized from existing one
throws:
  JiBXException - if error in configuration information



genFromText
abstract public void genFromText(ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to convert String representation. The code generated by this method assumes that the String value has already been pushed on the stack. It consumes this and leaves the converted value on the stack.
Parameters:
  mb - method builder
throws:
  JiBXException - if error in configuration



genParseOptional
abstract public void genParseOptional(boolean attr, ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to parse and convert optional attribute or element. This abstract base class method must be implemented by every subclass. The code generated by this method assumes that the unmarshalling context and name information for the attribute or element have already been pushed on the stack. It consumes these and leaves the converted value (or converted default value, if the item itself is missing) on the stack.
Parameters:
  attr - item is an attribute (vs element) flag
Parameters:
  mb - method builder
throws:
  JiBXException - if error in configuration



genParseRequired
abstract public void genParseRequired(boolean attr, ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to parse and convert required attribute or element. This abstract base class method must be implemented by every subclass. The code generated by this method assumes that the unmarshalling context and name information for the attribute or element have already been pushed on the stack. It consumes these and leaves the converted value on the stack.
Parameters:
  attr - item is an attribute (vs element) flag
Parameters:
  mb - method builder
throws:
  JiBXException - if error in configuration



genPopValues
public void genPopValues(int count, ContextMethodBuilder mb)(Code)
Generate code to pop values from stack.
Parameters:
  count - number of values to be popped
Parameters:
  mb - method builder



genToOptionalText
abstract protected BranchWrapper genToOptionalText(String type, ContextMethodBuilder mb, int extra) throws JiBXException(Code)
Generate code to check if an optional value is not equal to the default. This abstract base class method must be implemented by every subclass. The code generated by this method assumes that the actual value to be converted has already been pushed on the stack. It consumes this, leaving the converted text reference on the stack if it's not equal to the default value.
Parameters:
  type - fully qualified class name for value on stack
Parameters:
  mb - method builder
Parameters:
  extra - count of extra words to be popped from stack if missing handle for branch taken when value is equal to the default(target must be set by caller)
throws:
  JiBXException - if error in configuration



genToText
public void genToText(String type, ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to convert value to a String. The code generated by this method assumes that the actual value to be converted has already been pushed on the stack. It consumes this, leaving the converted text reference on the stack.
Parameters:
  type - fully qualified class name for value on stack
Parameters:
  mb - method builder
throws:
  JiBXException - if error in configuration



genWriteOptional
public void genWriteOptional(boolean attr, String type, ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to convert and write optional value to generated document. The generated code first tests if the value is the same as the supplied default, and if so skips writing. The code assumes that the marshalling context, the name information, and the actual value to be converted have already been pushed on the stack. It consumes these, leaving only the marshalling context on the stack.
Parameters:
  attr - item is an attribute (vs element) flag
Parameters:
  type - fully qualified class name for value on stack
Parameters:
  mb - method builder
throws:
  JiBXException - if error in configuration



genWriteRequired
public void genWriteRequired(boolean attr, String type, ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to convert and write required value to generated document. The code generated by this method assumes that the marshalling context, the name information, and the actual value to be converted have already been pushed on the stack. It consumes these, leaving the returned marshalling context on the stack.
Parameters:
  attr - item is an attribute (vs element) flag
Parameters:
  type - fully qualified class name for value on stack
Parameters:
  mb - method builder
throws:
  JiBXException - if error in configuration



genWriteText
public void genWriteText(boolean attr, ContextMethodBuilder mb)(Code)
Generate code to write String value to generated document. The code generated by this method assumes that the marshalling context, the name information, and the actual value to be converted have already been pushed on the stack. It consumes these, leaving the marshalling context on the stack.
Parameters:
  attr - item is an attribute (vs element) flag
Parameters:
  mb - method builder



getTypeName
public String getTypeName()(Code)
Get name of type handled by this conversion. fully qualified class name of type handled by conversion



isPrimitive
abstract public boolean isPrimitive()(Code)
Check if the type handled by this conversion is of a primitive type. true if a primitive type, false if anobject type



setDeserializer
protected void setDeserializer(String deser) throws JiBXException(Code)
Set deserializer for conversion. This finds the named static method and sets it as the deserializer to be used for this conversion. The deserializer method is expected to take a single argument of type String, and to return a value of the handled type or a subtype of that type.
Parameters:
  deser - fully qualified class and method name of deserializer
throws:
  JiBXException - if deserializer not found or not usable



setSerializer
protected void setSerializer(String ser) throws JiBXException(Code)
Set serializer for conversion. This finds the named static method and sets it as the serializer to be used for this conversion. The serializer method is expected to take a single argument of either the handled type or a superclass or interface of the handled type, and to return a String result.
Parameters:
  ser - fully qualified class and method name of serializer
throws:
  JiBXException - if serializer not found or not usable



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.