Java Doc for PrimitiveStringConversion.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
      org.jibx.binding.def.PrimitiveStringConversion

PrimitiveStringConversion
public class PrimitiveStringConversion extends StringConversion (Code)
Primitive string conversion handling. Class for handling serialization converting a primitive type to and from String values.
author:
   Dennis M. Sosnoski
version:
   1.0



Constructor Summary
protected  PrimitiveStringConversion(String type, PrimitiveStringConversion inherit)
     Constructor.
public  PrimitiveStringConversion(Class cls, Object dflt, String code, String ts, String fs, String uattr, String uelem)
     Constructor.

Method Summary
protected  ObjectconvertDefault(String text)
     Convert text representation into default value object.
public  StringConversionderive(String type, String ser, String dser, String dflt)
     Derive from existing formatting information.
public  voidgenFromText(ContextMethodBuilder mb)
     Generate code to convert String representation.
public  voidgenParseOptional(boolean attr, ContextMethodBuilder mb)
     Generate code to parse and convert optional attribute or element.
public  voidgenParseRequired(boolean attr, ContextMethodBuilder mb)
     Generate code to parse and convert required attribute or element.
protected  BranchWrappergenToOptionalText(String type, ContextMethodBuilder mb, int extra)
     Generate code to check if an optional value is not equal to the default. The code generated by this method assumes that the actual value to be converted has already been pushed on the stack.
public  booleanisPrimitive()
     Check if the type handled by this conversion is of a primitive type.
protected  voidpushDefault(ContextMethodBuilder mb)
     Push default value on stack.
protected  voidsetDeserializer(String deser)
     Set deserializer for conversion.
protected  voidsetSerializer(String ser)
     Set serializer for conversion.


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



PrimitiveStringConversion
public PrimitiveStringConversion(Class cls, Object dflt, String code, String ts, String fs, String uattr, String uelem)(Code)
Constructor. Initializes conversion handling based on argument values. This form is only used for constructing the default set of conversions.
Parameters:
  cls - class of primitive type handled by conversion
Parameters:
  dflt - default value object (wrapped value, or Stringor null with special deserializer)
Parameters:
  ts - name of utility class static method for converting value to String
Parameters:
  fs - name of utility class static method for convertingString to value
Parameters:
  uattr - unmarshalling context method name for attribute value
Parameters:
  uelem - unmarshalling context method name for element value




Method Detail
convertDefault
protected Object convertDefault(String text) throws JiBXException(Code)
Convert text representation into default value object. This override of the base class method uses reflection to call the actual deserialization method, returning the wrapped result value. If a custom deserializer is defined this just returns the String value directly.
Parameters:
  text - value representation to be converted converted default value object
throws:
  JiBXException - on conversion error



derive
public StringConversion derive(String type, String ser, String dser, String dflt) throws JiBXException(Code)
Derive from existing formatting information. This 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
public void genFromText(ContextMethodBuilder mb)(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



genParseOptional
public void genParseOptional(boolean attr, ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to parse and convert optional attribute or element. 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 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
public void genParseRequired(boolean attr, ContextMethodBuilder mb) throws JiBXException(Code)
Generate code to parse and convert required attribute or element. 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



genToOptionalText
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. 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 values 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



isPrimitive
public boolean isPrimitive()(Code)
Check if the type handled by this conversion is of a primitive type. true to indicate primitive type



pushDefault
protected void pushDefault(ContextMethodBuilder mb)(Code)
Push default value on stack. Just adds the appropriate instruction to the list for the method.
Parameters:
  mb - method builder



setDeserializer
protected void setDeserializer(String deser) throws JiBXException(Code)
Set deserializer for conversion. This override of the base class method sets a flag to indicate that values must be read from a document as text and converted as a separate step after executing the base class processing.
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 override of the base class method sets a flag to indicate that values must be converted to text before they are written to a document after executing the base class processing.
Parameters:
  ser - fully qualified class and method name of serializer
throws:
  JiBXException - if serializer not found or not usable



Fields inherited from org.jibx.binding.def.StringConversion
final protected static String COMPARE_OBJECTS_METHOD(Code)(Java Doc)
final protected static String COMPARE_OBJECTS_SIGNATURE(Code)(Java Doc)
final protected static String[] DESERIALIZER_SIGNATURES(Code)(Java Doc)
final protected static String MARSHAL_ATTRIBUTE(Code)(Java Doc)
final protected static String MARSHAL_ELEMENT(Code)(Java Doc)
final public static int MARSHAL_NAME_VALUES(Code)(Java Doc)
final protected static String MARSHAL_SIGNATURE(Code)(Java Doc)
final protected static String UNMARSHAL_OPT_ATTRIBUTE(Code)(Java Doc)
final protected static String UNMARSHAL_OPT_ELEMENT(Code)(Java Doc)
final protected static String UNMARSHAL_OPT_SIGNATURE(Code)(Java Doc)
final protected static String UNMARSHAL_REQ_ATTRIBUTE(Code)(Java Doc)
final protected static String UNMARSHAL_REQ_ELEMENT(Code)(Java Doc)
final protected static String UNMARSHAL_REQ_SIGNATURE(Code)(Java Doc)
protected Object m_default(Code)(Java Doc)
protected ClassItem m_deserializer(Code)(Java Doc)
protected ClassItem m_serializer(Code)(Java Doc)
protected String m_typeName(Code)(Java Doc)
protected String m_typeSignature(Code)(Java Doc)

Methods inherited from org.jibx.binding.def.StringConversion
abstract protected Object convertDefault(String text) throws JiBXException(Code)(Java Doc)
abstract public StringConversion derive(String type, String ser, String dser, String dflt) throws JiBXException(Code)(Java Doc)
abstract public void genFromText(ContextMethodBuilder mb) throws JiBXException(Code)(Java Doc)
abstract public void genParseOptional(boolean attr, ContextMethodBuilder mb) throws JiBXException(Code)(Java Doc)
abstract public void genParseRequired(boolean attr, ContextMethodBuilder mb) throws JiBXException(Code)(Java Doc)
public void genPopValues(int count, ContextMethodBuilder mb)(Code)(Java Doc)
abstract protected BranchWrapper genToOptionalText(String type, ContextMethodBuilder mb, int extra) throws JiBXException(Code)(Java Doc)
public void genToText(String type, ContextMethodBuilder mb) throws JiBXException(Code)(Java Doc)
public void genWriteOptional(boolean attr, String type, ContextMethodBuilder mb) throws JiBXException(Code)(Java Doc)
public void genWriteRequired(boolean attr, String type, ContextMethodBuilder mb) throws JiBXException(Code)(Java Doc)
public void genWriteText(boolean attr, ContextMethodBuilder mb)(Code)(Java Doc)
public String getTypeName()(Code)(Java Doc)
abstract public boolean isPrimitive()(Code)(Java Doc)
protected void setDeserializer(String deser) throws JiBXException(Code)(Java Doc)
protected void setSerializer(String ser) throws JiBXException(Code)(Java Doc)

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.