Java Doc for JOXBeanInput.java in  » XML » jox » com » wutka » jox » 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 » jox » com.wutka.jox 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.wutka.jox.JOXBeanInput

JOXBeanInput
class JOXBeanInput (Code)
Performs the actual reading of an XML document and copies the values into a bean. This class uses the DocumentBuilder portion of the Java XML API. It is not as efficient as SAX, but much easier to deal with when copying values into beans.
author:
   Mark Wutka
version:
   1.0 05/08/2000
version:
   1.1 05/09/2000
version:
   1.6 07/30/2000


Field Summary
protected static  HashtablebeanCache
    
protected static  DocumentBuilderFactoryfactory
     The document builder factory used to instantiate new document builders.


Method Summary
public static  StringgetElementString(Element element)
     Searches the children of an element looking for a Text node.
public  ObjectgetObjectValue(PropertyDescriptor desc, Element element)
     Examines a property's type to see which method should be used to parse the property's value.
public  ObjectgetObjectValue(PropertyDescriptor desc, String value)
     Examines a property's type to see which method should be used to parse the property's value.
public static  booleannamesMatch(String beanName, String elementName)
     Returns true if two names match without regard to case or the presence of '-' or '_' characters.
public static  ObjectparseBasicType(Class type, String str)
    
public  ObjectparseDate(String str, DateFormat dateFormat)
    
public static  ObjectreadBasicType(Class type, Element element)
    
public  ObjectreadDate(Element element)
    
public  voidreadIndexedProperty(Object ob, IndexedPropertyDescriptor desc, NodeList nodes, NamedNodeMap attrs)
     Reads XML element(s) into an indexed bean property by first locating the XML element(s) corresponding to this property.
public  voidreadObject(Object ob, InputSource source)
    
public  voidreadObject(Object ob, Element element)
     Reads the children of an XML element and matches them to properties of a bean.
public  voidreadProperty(Object ob, PropertyDescriptor desc, NodeList nodes, NamedNodeMap attrs)
     Reads an XML element into a bean property by first locating the XML element corresponding to this property.

Field Detail
beanCache
protected static Hashtable beanCache(Code)



factory
protected static DocumentBuilderFactory factory(Code)
The document builder factory used to instantiate new document builders.





Method Detail
getElementString
public static String getElementString(Element element)(Code)
Searches the children of an element looking for a Text node. If it finds one, it returns it.
Parameters:
  element - The element whose children will be searched The text for the element, or null if there is none



getObjectValue
public Object getObjectValue(PropertyDescriptor desc, Element element) throws IOException(Code)
Examines a property's type to see which method should be used to parse the property's value.
Parameters:
  desc - The description of the property
Parameters:
  element - The XML element containing the property value The value stored in the element
throws:
  IOException - If there is an error reading the document



getObjectValue
public Object getObjectValue(PropertyDescriptor desc, String value) throws IOException(Code)
Examines a property's type to see which method should be used to parse the property's value.
Parameters:
  desc - The description of the property
Parameters:
  value - The value of the XML attribute containing the prop value The value stored in the element
throws:
  IOException - If there is an error reading the document



namesMatch
public static boolean namesMatch(String beanName, String elementName)(Code)
Returns true if two names match without regard to case or the presence of '-' or '_' characters.
Parameters:
  beanName - The name of the bean property to compare
Parameters:
  elementName - The name of the element to compare True if the names match



parseBasicType
public static Object parseBasicType(Class type, String str)(Code)
Reads an string into a basic type
Parameters:
  type - The type of the string to read
Parameters:
  str - The string containing the value The parsed value of the string



parseDate
public Object parseDate(String str, DateFormat dateFormat) throws IOException(Code)
Parses a string as a date
Parameters:
  str - The string containing the date The date value parsed from the string
throws:
  IOException - If there's an error parsing the date



readBasicType
public static Object readBasicType(Class type, Element element)(Code)
Reads an XML text element into a basic type
Parameters:
  type - The type of the element to read
Parameters:
  element - The element containing the value The parsed value of the element



readDate
public Object readDate(Element element) throws IOException(Code)
Parses an XML element as a date
Parameters:
  element - The element containing the date The date value parsed from the element
throws:
  IOException - If there's an error parsing the date



readIndexedProperty
public void readIndexedProperty(Object ob, IndexedPropertyDescriptor desc, NodeList nodes, NamedNodeMap attrs) throws IOException(Code)
Reads XML element(s) into an indexed bean property by first locating the XML element(s) corresponding to this property.
Parameters:
  ob - The bean whose property is being set
Parameters:
  desc - The property that will be set
Parameters:
  nodes - The list of XML items that may contain the property
throws:
  IOException - If there is an error reading the document



readObject
public void readObject(Object ob, InputSource source) throws IOException(Code)
Reads an XML document from an input source and copies its values into the specified object
Parameters:
  ob - The object to receive the values
Parameters:
  source - The location of the XML document
throws:
  IOException - If there is an error reading the document



readObject
public void readObject(Object ob, Element element) throws IOException(Code)
Reads the children of an XML element and matches them to properties of a bean.
Parameters:
  ob - The bean to receive the values
Parameters:
  element - The element the corresponds to the bean
throws:
  IOException - If there is an error reading the document



readProperty
public void readProperty(Object ob, PropertyDescriptor desc, NodeList nodes, NamedNodeMap attrs) throws IOException(Code)
Reads an XML element into a bean property by first locating the XML element corresponding to this property.
Parameters:
  ob - The bean whose property is being set
Parameters:
  desc - The property that will be set
Parameters:
  nodes - The list of XML items that may contain the property
throws:
  IOException - If there is an error reading the document



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.