org.exolab.castor.xml

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 » Database ORM » castor » org.exolab.castor.xml 
org.exolab.castor.xml

The XML Marshaller API

Version:
$Revision: 6213 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Keith Visco

{@link org.exolab.castor.xml.Marshaller} marshalls a Java object into an XML document. {@link org.exolab.castor.xml.Unmarshaller} unmarshalls an XML document back into a Java object.

The following example unmarshals the XML document product.xml into a Product object, performs simple changes to the object and then marshals it back into an XML document.

  Product      prod;
  File         file;

  file = new File( "product.xml" );

  // Unmarshal the document into an object
  prod = (Product) Unmarshaller.unmarshal( Product.class, new FileReader( file ) );

  // A 25% mark down for each product and mark as sale
  prod.markDown( 0.25 );
  prod.setOnSale( true );

  // Marshal the object into a document
  Marshaller.marshal( Product, new FileWriter( file ) );
    

In addition to static methods, marshaller objects can be created and set with a variety of options affecting how they will operation. The above example adapted to use a specific mapping file:

  Mapping      map;
  Unmarshaller umr;
  Marshaller   mar;

  // Load the specified mapping file
  map = new Mapping();
  map.loadMapping( "mapping.xml" );

  // Unmarshal the document into an object
  umr = new Unmarshaller( Product.class );
  umr.setMapping( mapping );
  prod = (Product) umr.unmarshal( new FileReader( file ) );

  : : :

  // Marshal the object into a document
  mar = new Marshaller( new FileWriter( file ) );
  mar.setMapping( mapping );
  mar.marshal( Product );
    
Java Source File NameTypeComment
AccessRights.javaClass
AttributeSet.javaInterface A simple interface for handling Attributes in the Marshalling Framework.
CastorException.javaClass
ClassDescriptorResolver.javaInterface An interface for finding or "resolving" ClassDescriptor classes.
ClassDescriptorResolverFactory.javaClass
DebugHandler.javaClass A Simple SAX1 DocumentHandler that intercepts SAX events and prints them to the console.
DescriptorType.javaClass This class represents the Possible Descriptor types used by the marshalling Framework.
EventProducer.javaInterface A interface which abstracts anything which can produce SAX events.
FieldValidator.javaClass Handles field validation.
IDResolver.javaInterface A simple interface for doing custom IDREF resolving during Unmarshalling.
IDResolverImpl.javaClass Default IDResolver for Castor XML during (un)marshaling.
Introspector.javaClass A Helper class for the Marshaller and Unmarshaller, basically the common code base between the two.
JavaNaming.javaClass This class converts XML Names to proper Java names.
MarshalException.javaClass An exception that is used to signal marshalling exceptions.
MarshalFramework.javaClass
Marshaller.javaClass A Marshaller that serializes Java Object's to XML Note: This class is not thread safe, and not intended to be, so please create a new Marshaller for each thread if it is to be used in a multithreaded environment.
MarshalListener.javaInterface An interface to allow external "listening" to objects when they are being marshalled for various tracking purposes and potential modification, and to prevent an object from being marshalled if necessary.
Namespaces.javaClass
NodeType.javaClass The possible node types for an XML field.
OutputFormat.javaInterface Output format contract for XML serialization.
ProcessingInstruction.javaClass An immutable class that represents an XML processing instruction.
ReferenceInfo.javaClass Internal class used to save state for reference resolving.
ResolverException.javaClass
SAX2EventProducer.javaInterface A interface which abstracts anything which can produce SAX 2 events.
Serializer.javaInterface Interface contract for XML serialization business.
TestUnmarshaller.javaClass Test case for testing various pieces of functionality of Unmarshaller .
TypeValidator.javaInterface The basic type validation interface class.
UnmarshalHandler.javaClass An unmarshaller to allowing unmarshaling of XML documents to Java Objects.
Unmarshaller.javaClass An unmarshaller to allowing unmarshalling of XML documents to Java Objects.
UnmarshalListener.javaInterface An interface to allow external "listening" to objects when they are being unmarshalled for various tracking purposes and potential modification.
UnmarshalState.javaClass
ValidationContext.javaClass A class which can be used to hold validation information, used by the TypeValidator interface.
ValidationException.javaClass An Exception that can be used to signal XML validation errors.
Validator.javaClass A class which can perform Validation on an Object model.
XercesJDK5OutputFormat.javaClass Xerces-specific OutputFormat instance, used with JDK 5.0 only.
XercesJDK5Serializer.javaClass Xerces-specific implementation of the Serializer interface, used for JDK 5 only where Xerecs has been integrated with the core code base.
XercesJDK5XMLSerializerFactory.javaClass Xerces-specific implementation of the XMLSerializerFactory interface.
XercesOutputFormat.javaClass Xerces-specific OutputFormat instance.
XercesSerializer.javaClass Xerces-specific implementation of the Serializer interface.
XercesXMLSerializerFactory.javaClass Xerces-specific implementation of the XMLSerializerFactory interface.
XMLClassDescriptor.javaInterface A class descriptor for describing relationships between a Class and an XML element or complexType.
XMLClassDescriptorResolver.javaInterface An interface for finding or "resolving" XMLClassDescriptor classes.
XMLConstants.javaInterface Constants used by all of Castor-XML are defined here.
XMLContext.javaClass Bootstrap class for Castor XML that allows you to load information about the domain objects used with Castor XML (marshallers and unmarshallers) by various means.
XMLContextTest.javaClass
XMLException.javaClass An exception that is used to signal an error that has occured during marshaling or unmarshaling.
XMLFieldDescriptor.javaInterface XML field descriptor.
XMLFieldHandler.javaClass This FieldHandler is used in the generated descriptors.
XMLMappingLoader.javaClass An XML implementation of mapping helper.
XMLNaming.javaClass
XMLSerializerFactory.javaInterface Configurable factory object for XML serialization.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.