castor

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 
Castor
License:New Apache-style license
URL:www.castor.org
Description: Castor is an Open Source data binding framework for Java.
Package NameComment
codegen
dsml
dtx
jdo
log4j
myapp
oes
org.castor

New root package for all new classes added to Castor as of release 0.9.7. As discussed in the license help file, all new files added to the project and hence this package as of release 0.9.7 (or refactored to a great extent) will carry a new Apache-style license.

org.castor.anttask Ant task for Castor code generator This package contains ant task for Castor code generator.
Author:
Joel Farquhar
Author:
Bruce Snyder
org.castor.ddlgen Castor DDL Generator package This package contains functional classes, exceptions and Main class for DDL generator.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.db2 Castor DDL Generator package This package contains final classes to create DDL for DB2.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.derby Castor DDL Generator package This package contains final classes to create DDL for Derby.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.hsql Castor DDL Generator package This package contains final classes to create DDL for Hsql.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.mssql Castor DDL Generator package This package contains final classes to create DDL for Microsoft SQL Server.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.mysql Castor DDL Generator package This package contains final classes to create DDL for MySQL.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.oracle Castor DDL Generator package This package contains final classes to create DDL for Oracle.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.pointbase Castor DDL Generator package This package contains final classes to create DDL for PointBase.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.postgresql Castor DDL Generator package This package contains final classes to create DDL for PostgreSQL.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.sapdb Castor DDL Generator package This package contains final classes to create DDL for SapDB.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.engine.sybase Castor DDL Generator package This package contains final classes to create DDL for Sybase.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.keygenerator Castor DDL Generator package This package contains various various key generator implementations as well as factory classes for all of the key generators.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.schemaobject Castor DDL Generator package This package contains SchemaObject's for ddl generation including Table, Field, KeyGenerator, Index, Schema,ForeignKey and PrimaryKey. SchemaObject's support generation of 'standard' DDL for various databases. Specific databases must overwrite some SchemaObject's if the target DDL is different from the 'standard'.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.ddlgen.test.framework
org.castor.ddlgen.typeinfo Castor DDL Generator package This package contains various type definitions which implement the TypeInfo interface.
Author:
Le Duc Bao
Author:
Ralf Joachim
org.castor.mapping
org.castor.test.entity
org.castor.util
org.castor.util.concurrent Concurrent package

This package contains classes taken from EDU.oswego.cs.dl.util.concurrent library Version 1.3.4.

Author:
Doug Lea
org.exolab.castor.builder Castor XML code generator

Castor XML code generator

Version:
$Revision: 6713 $
Author:
Keith Visco
Author:
Arnaud Blandin

This package is primarily used with Castor XML, however some people do use it for Castor JDO. Some incompatabilities may exist.

The class {@link org.exolab.castor.builder.SourceGenerator} is used for creating Java source code from an XML Schema. Currently the version of XML Schema that is supported by the SourceGenerator is a subset of the W3C XML Schema 1.0 Recommendation (20010502). A binding file can be used to customize the generated sources. More information may be obtained in the Castor documentation.

The class {@link org.exolab.castor.builder.SourceGeneratorMain} is the main(String[]) entry point used when invoking the source generator from the command line. This class parses the command-line arguments, sets up the proper configuration, and then passes control to org.exolab.castor.builder.SourceGenerator.

The file org/exolab/castor/builder/castorbuilder.properties is used for configuring some advanced options.

org.exolab.castor.builder.binding Binding File Object Model for Castor XML code generator

Binding File Object Model for Castor XML code generator

Version:
$Revision: 6713 $
Author:
Arnaud Blandin
Author:
Keith Visco

This package contains the object model that represents an in-memory binding file. The binding file allows one to customize the source generated by the Castor Source Generator.

The class {@link org.exolab.castor.builder.binding.XMLBindingComponent} is the XML Schema driven implementation of {@link org.exolab.castor.builder.BindingComponent} and contains the logic to bind an XML Schema structure to a java property. More information may be obtained in the Castor documentation.

Much of the source in this package is itself generated using the Castor Source Generator and the schema src/main/resources/org/exolab/castor/builder/binding/binding.xsd.

org.exolab.castor.builder.binding.xml
org.exolab.castor.builder.binding.xml.descriptors
org.exolab.castor.builder.binding.xml.types
org.exolab.castor.builder.binding.xml.types.descriptors
org.exolab.castor.builder.conflict.strategy
org.exolab.castor.builder.conflictresolution
org.exolab.castor.builder.descriptors
org.exolab.castor.builder.factory
org.exolab.castor.builder.info
org.exolab.castor.builder.types
org.exolab.castor.builder.util
org.exolab.castor.core.exceptions
org.exolab.castor.dsml DSML

The DSML API for importing/exporting LDAP directories as XML

Version:
$Revision: 5951 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Assaf Arkin
org.exolab.castor.dsml.jndi DSML - JNDI Implementation

DSML implementation using the JNDI API.

Version:
$Revision: 5951 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Assaf Arkin
org.exolab.castor.dsml.mozilla DSML - Mozilla Implementation

DSML implementation using the Mozilla Directory SDK.

Version:
$Revision: 5951 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Assaf Arkin
org.exolab.castor.dsml.schema
org.exolab.castor.dsml.tools
org.exolab.castor.mapping

The Class Mapping API

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

This package provides a common base for the class mapping descriptors and tools to generate mapping descriptors from a mapping file. The Java objects for the XML-based mapping file are contained in the sub-package xml and the DTD and XML schema originate in this package. The sub-package loader implements a mapping loader.

{@link org.exolab.castor.mapping.Mapping} serves as a generic mapping loader that can be used to load multiple mapping files and feed them to the XML marshaller, JDO engine, and DAX engine.

{@link org.exolab.castor.mapping.ClassDescriptor} is a mapping descriptor for a Java class, consisting of any number of fields. {@link org.exolab.castor.mapping.FieldDescriptor} is a mapping descriptor for a Java field within that class. Access to the field value is granted through a {@link org.exolab.castor.mapping.FieldHandler}, obtained from the field descriptor.

The following example illustrates how to load a mapping file with the current class loader and use it to marshal an object:

  Mapping      map;
  Marshaller   mar;

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

  // Marshal the object into a document
  mar = new Marshaller( output );
  mar.setMapping( mapping );
  mar.marshal( object );
    
org.exolab.castor.mapping.handlers
org.exolab.castor.mapping.loader

Implementations for mapping interfaces and the default mapping loader.

Version:
$Revision: 5951 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Assaf Arkin
org.exolab.castor.mapping.xml

XML objects for loading the mapping file.

The source in this package is generated using the Castor Source Generator, the schema src/main/resources/org/exolab/castor/mapping/mapping.xsd, and the mapping file src/main/resources/org/exolab/castor/mapping/mapping-binding.xml.

org.exolab.castor.mapping.xml.types
org.exolab.castor.net
org.exolab.castor.net.util
org.exolab.castor.tools

Command line tools

Version:
$Revision: 5951 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Assaf Arkin
Author:
Keith Visco
org.exolab.castor.tools.ant.taskdefs Ant task for Castor code generator This package contains ant task for Castor code generator.
Author:
Joel Farquhar
Author:
Bruce Snyder
org.exolab.castor.types

The Castor implementation of specific XML Schema Types

Version:
$Revision: 6213 $
Author:
Arnaud Blandin

This package contains the implementation of the date/time datatypes defined in W3C XML Schema 1.0 Recommendation. Those types are needed by the marshalling framework and the source generator.

org.exolab.castor.util

Utility classes used by Castor.

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

org.exolab.castor.util.dialog
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 );
    
org.exolab.castor.xml.descriptors
org.exolab.castor.xml.dtd

The XML DTD Object Model

Version:
$Revision: 6213 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Alexander Totok
This package is an implementation of the XML DTD specification.

The XML DTD object model does not implement:

  • Conditional Sections:
    <![ INCLUDE [ ... ]]>
    <![ IGNORE  [ ... ]]> 
  • Processing Instructions, like:
    <?xml version="1.0" encoding="UTF-16"?> 

The XML DTD object model is fully compliant with the current XML specification, unless otherwise is stated.

This package also contains the class {@link org.exolab.castor.xml.dtd.Converter Converter}, which provides static top-level methods to parse and convert XML DTD documents to corresponding XML Schema documents. It also contains a simple command line interface to read an XML DTD file and create a corresponding XML Schema file.

org.exolab.castor.xml.dtd.parser

The XML DTD Parser API

Version:
$Revision: 6213 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Alexander Totok
This package consists of two parsers:
  • {@link org.exolab.castor.xml.dtd.parser.DTDInitialParser Initial Parser} parses the input text, searches for parameter entity declarations (i.e. entities used only within XML DTD) and substitutes parameter entity references by corresponding replacement text. All other text is passed to the output "as is".
    The initial parser parses internal parameter entity declarations only, like:
    <!ENTITY % name "John White" > 
    signaling an error if an external parameter entity declaration, like:
    <!ENTITY % ISOLat2 SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" >
    is met. Future versions will be able to parse and handle external parameter entity declarations.
    The output of this parser is a document without paramater entity declarations and all parameter entity references substituted by corresponding replacement text.
  • {@link org.exolab.castor.xml.dtd.parser.DTDParser Main Parser} performes the main parsing process. It is able to parse:
    • ELEMENT declarations
    • ATTRIBUTE declarations
    • GENERAL ENTITY declarations
    • NOTATION declarations
    • Comments
    The parser does not parse:
    • Conditional Sections:
      <![ INCLUDE [ ... ]]>
      <![ IGNORE  [ ... ]]> 
    • Processing Instructions, like:
      <?xml version="1.0" encoding="UTF-16"?> 
    The parser does not expand general entity references or character references occurring within attribute and entity values.

The parser is fully compliant with the current XML specification, unless otherwise is stated, for instance it is able to parse Unicode text, provided the {@link java.io.Reader java.io.Reader} used to instantiate the parser is correctly set up.

The structure of the package:

The parser was written using JavaCC (Java Compiler Compiler) - an automated tool to generate Java programming language parsers.

This package consists of the following classes and files:

  • DTDInitialParser.jj - initial parser's JavaCC grammar file with the syntax specification and processing code. This file is used by JavaCC to automatically generate Java classes for the initial parser.
  • {@link org.exolab.castor.xml.dtd.parser.DTDInitialParser DTDInitialParser}, {@link org.exolab.castor.xml.dtd.parser.DTDInitialParserConstants DTDInitialParserConstants}, {@link org.exolab.castor.xml.dtd.parser.DTDInitialParserTokenManager DTDInitialParserTokenManager} - classes of the initial parser automatically generated by JavaCC from the DTDInitialParser.jj file.
  • DTDParser.jj - main parser's JavaCC grammar file with the syntax specification and processing code. This file is used by JavaCC to automatically generate Java classes for the main parser.
  • {@link org.exolab.castor.xml.dtd.parser.DTDParser DTDParser}, {@link org.exolab.castor.xml.dtd.parser.DTDParserConstants DTDParserConstants}, {@link org.exolab.castor.xml.dtd.parser.DTDParserTokenManager DTDParserTokenManager} - classes of the main parser automatically generated by JavaCC from the DTDParser.jj file.
  • {@link org.exolab.castor.xml.dtd.parser.Token Token}, {@link org.exolab.castor.xml.dtd.parser.ParseException ParseException}, {@link org.exolab.castor.xml.dtd.parser.TokenMgrError TokenMgrError}, {@link org.exolab.castor.xml.dtd.parser.CharStream CharStream} - classes used by both parsers and suitable for any grammar. JavaCC first looks for these files and generates them only if they are absent. But do not edit the first line of these files, as JavaCC will give warning message about being unable to authenticate them.
    {@link org.exolab.castor.xml.dtd.parser.TokenMgrError TokenMgrError} is thrown if the Token Manager of the parser has encountered a syntax error in the text of DTD document and is unable to produce next token.
    {@link org.exolab.castor.xml.dtd.parser.ParseException ParseException} is thrown if a DTD document does not comply with the DTD syntax and the parser is unable to parse the document.
  • {@link org.exolab.castor.xml.dtd.parser.InputCharStream InputCharStream} - an implementation of interface {@link org.exolab.castor.xml.dtd.parser.CharStream CharStream}. Implements an input character stream that maintains line and column number positions of the characters. It also has the capability to backup the stream to some extent.
    The object of this class is constructed using a {@link java.io.Reader java.io.Reader} reader and it is left to constructor of the reader to set up character encoding correctly. This means that method read of the reader is used to get the next characters, assuming it returns appropriate values. It is recommended to use class {@link java.io.InputStreamReader java.io.InputStreamReader} as a reader, which allows you to set the desired character encoding. This class is an intermediate component between input character reader and the parser.
    The code of this class is based on the class ASCII_CharStream - implementation of interface {@link org.exolab.castor.xml.dtd.parser.CharStream CharStream}, that JavaCC would have generated with the following options set in a JavaCC grammar file:
      JAVA_UNICODE_ESCAPE = false;
      UNICODE_INPUT = false;
      USER_CHAR_STREAM = false; 
    Note that this class is not fully JavaCC generated.

The following example parses the XML DTD file dtd-document.dtd and constructs the corresponding {@link org.exolab.castor.xml.dtd.DTDdocument XML DTD document} object dtd.

  FileInputStream inputStream;
  InputStreamReader reader;
  InputCharStream charStream;
  DTDInitialParser initialParser;
  String intermedResult;
  StringReader strReader;
  DTDParser parser;
  DTDdocument dtd;

  // instantiate input byte stream, associated with the input file
  inputStream = new FileInputStream( "dtd-document.dtd" );

  // instantiate character reader from the input file byte stream
  reader = new InputStreamReader( inputStream, "US-ASCII" );

  // instantiate char stream for initial parser from the input reader
  charStream = new InputCharStream( reader );

  // instantiate initial parser
  initialParser = new DTDInitialParser( charStream );

  // get result of initial parsing - DTD text document with parameter
  // entity references expanded
  intermedResult = initialParser.Input();

  // construct StringReader from the intermediate parsing result
  strReader= new StringReader( intermedResult );

  // instantiate char stream for the main parser
  charStream = new InputCharStream( strReader );

  // instantiate main parser
  parser = new DTDParser( charStream );

  // parse intermediate parsing result with the main parser
  // and get corresponding DTD document oblect
  dtd = parser.Input();
    
org.exolab.castor.xml.handlers
org.exolab.castor.xml.location
org.exolab.castor.xml.schema
org.exolab.castor.xml.schema.reader
org.exolab.castor.xml.schema.simpletypes
org.exolab.castor.xml.schema.simpletypes.factory
org.exolab.castor.xml.schema.util
org.exolab.castor.xml.schema.writer
org.exolab.castor.xml.util
org.exolab.castor.xml.validators
org.exolab.castor.xml.wls8
org.exolab.javasource Java Source classes for Castor XML code generator This package contains classes that represent Java Source objects for Castor XML code generator.
Author:
Keith Visco
Author:
Martin Skopp
Author:
Gary Shea
Author:
Andrew Fawcett
Author:
Werner Guttmann
Author:
Ralf Joachim
tools
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.