db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r171348 [1/7] - in /incubator/jdo/trunk/core20: ./ src/ src/conf/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/jdo/ src/java/org/apache/jdo/impl/ src/java/org/apache/jdo/impl/model/ src/java/org/apache/jdo/impl/model/java/ src/java/org/apache/jdo/impl/model/java/reflection/ src/java/org/apache/jdo/impl/model/jdo/ src/java/org/apache/jdo/impl/model/jdo/caching/ src/java/org/apache/jdo/impl/model/jdo/util/ src/java/org/apache/jdo/impl/model/jdo/xml/ src/java/org/apache/jdo/model/ src/java/org/apache/jdo/model/java/ src/java/org/apache/jdo/model/jdo/ src/java/org/apache/jdo/util/
Date Sun, 22 May 2005 17:44:23 GMT
Author: mbo
Date: Sun May 22 10:44:19 2005
New Revision: 171348

URL: http://svn.apache.org/viewcvs?rev=171348&view=rev
Log:
First version of JDO2 implementation (Core). It includes utility and meta model classes

Added:
    incubator/jdo/trunk/core20/
    incubator/jdo/trunk/core20/maven.xml
    incubator/jdo/trunk/core20/project.properties
    incubator/jdo/trunk/core20/project.xml
    incubator/jdo/trunk/core20/src/
    incubator/jdo/trunk/core20/src/conf/
    incubator/jdo/trunk/core20/src/conf/commons-logging.properties
    incubator/jdo/trunk/core20/src/conf/logging.properties
    incubator/jdo/trunk/core20/src/conf/simplelog.properties
    incubator/jdo/trunk/core20/src/java/
    incubator/jdo/trunk/core20/src/java/org/
    incubator/jdo/trunk/core20/src/java/org/apache/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaField.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModel.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModelFactory.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaField.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/Bundle.properties
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/ErrorType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/FloatingPointType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/IntegralType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedCollectionType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedMapType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JavaModel-Impl.jpg   (with props)
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/MutableValueClassType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/NullType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/PredefinedType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/PrimitiveType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/ValueClassType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/WrapperClassType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/package.html
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/reflection/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/reflection/ReflectionJavaField.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/reflection/ReflectionJavaModel.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/reflection/ReflectionJavaType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/Bundle.properties
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOArrayImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOClassImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOCollectionImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOElementImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOExtensionImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOFieldImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOMapImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOMemberImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOModelFactoryImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOModelImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOPackageImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOReferenceImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDORelationshipImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/JDOArrayImplCaching.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/JDOClassImplCaching.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/JDOCollectionImplCaching.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/JDOFieldImplCaching.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/JDOMapImplCaching.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/JDOModelFactoryImplCaching.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/caching/JDOModelImplCaching.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/package.html
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/PrintSupport.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/TypeSupport.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOHandler.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOHandlerImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOParser.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/Bundle.properties
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/ModelException.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/ModelFatalException.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/ModelValidationException.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/ModelVetoException.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/JavaField.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/JavaModel-API.jpg   (with props)
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/JavaModel.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/JavaModel.mdl   (with props)
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/JavaModelFactory.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/JavaType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/java/package.html
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOArray.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOClass.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOCollection.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOElement.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOExtension.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOField.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOIdentityType.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOMap.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOMember.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOModel.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOModel.jpg   (with props)
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOModel.mdl   (with props)
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOModelFactory.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOModelHelper.jpg   (with props)
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOPackage.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDOReference.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDORelationship.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/NullValueTreatment.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/PersistenceModifier.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/package.html
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/package.html
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/Bundle.properties
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/I18NHelper.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/JDOJdk14Logger.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/JDORIVersion.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/Pool.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/WeakHashSet.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/WeakValueHashMap.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/util/package.html

Added: incubator/jdo/trunk/core20/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/maven.xml?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/maven.xml (added)
+++ incubator/jdo/trunk/core20/maven.xml Sun May 22 10:44:19 2005
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<project default="default"
+    xmlns:j="jelly:core"
+    xmlns:ant="jelly:ant"
+    xmlns:maven="jelly:maven"
+    >
+
+    <!-- ==================== -->
+    <!-- Default Global Goals -->
+    <!-- ==================== -->
+
+    <goal name="default">
+        <attainGoal name="jar:install-snapshot"/>
+    </goal>
+
+    <goal name="build">
+        <attainGoal name="default"/>
+    </goal>
+
+    <goal name="rebuild">
+        <attainGoal name="clean"/>
+        <attainGoal name="build"/>
+    </goal>
+
+    <goal name="clobber" prereqs="clean">
+        <delete>
+            <fileset dir="." defaultexcludes="no" includes="**/*~"/>
+        </delete>
+    </goal>
+
+</project>

Added: incubator/jdo/trunk/core20/project.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/project.properties?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/project.properties (added)
+++ incubator/jdo/trunk/core20/project.properties Sun May 22 10:44:19 2005
@@ -0,0 +1,18 @@
+#
+# Copyright 2005 The Apache Software Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at 
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software 
+# distributed under the License is distributed on an "AS IS" BASIS, 
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+# See the License for the specific language governing permissions and 
+# limitations under the License.
+
+# checkstyle settings
+maven.checkstyle.properties = ${basedir}/../jdo_checks.xml
+

Added: incubator/jdo/trunk/core20/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/project.xml?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/project.xml (added)
+++ incubator/jdo/trunk/core20/project.xml Sun May 22 10:44:19 2005
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../project.xml</extend>
+    <!-- ============== -->
+    <!-- Identification -->
+    <!-- ============== -->
+    <name>JDO2 Implementation (Core)</name>
+    <artifactId>jdo2-core</artifactId>
+    <currentVersion>2.0</currentVersion>
+    <package>org.apache.jdo</package>
+    <shortDescription>Java Data Object 2.0 (JDO) Core</shortDescription>
+    <description>The Java Data Objects 2.0 (JDO) API is a standard interface-based 
+Java model abstraction of persistence, developed as Java Specification 
+Request JSR 243 under the auspices of the Java Community Process.</description>
+    <repository />
+    <!-- ============ -->
+    <!-- Dependencies -->
+    <!-- ============ -->
+    <dependencies>
+        <dependency>
+            <id>commons-logging</id>
+            <version>1.0.4</version>
+        </dependency>
+    </dependencies>
+    <!-- =================== -->
+    <!-- Build Specification -->
+    <!-- =================== -->
+    <build>
+        <sourceDirectory>src/java</sourceDirectory>
+        <!-- J A R  R E S O U R C E S -->
+        <!-- Resources that are packaged up inside the JAR file -->
+        <resources>
+            <resource>
+                <directory>${basedir}/src/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+</project>
+

Added: incubator/jdo/trunk/core20/src/conf/commons-logging.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/conf/commons-logging.properties?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/conf/commons-logging.properties (added)
+++ incubator/jdo/trunk/core20/src/conf/commons-logging.properties Sun May 22 10:44:19 2005
@@ -0,0 +1,37 @@
+#
+# Copyright 2005 The Apache Software Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at 
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software 
+# distributed under the License is distributed on an "AS IS" BASIS, 
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+# See the License for the specific language governing permissions and 
+# limitations under the License.
+
+#
+# This is a sample apache commons logging configuration file defining logging
+# properties for the JDO2 Implementation (Enhancer) sources. It defines what
+# logging implementation the apache commons logging API should use by specifying
+# the property org.apache.commons.logging.Log (see below). Please note, that
+# there are separate property files for each logging implementation to set the
+# log level of the loggers:
+# - SimpleLog:      simplelog.properties 
+# - JDK1.4 logging: logging.properties
+#
+# The JDO2 Implementation (Core) sources use the following logger instances:
+# org.apache.jdo.util                 Utility classes
+# org.apache.jdo.impl.model.jdo       JDOModel implementation
+# org.apache.jdo.impl.model.jdo.xml   XML parser for JDO metadata files
+#
+
+# Uncomment the next line if you want to use the apache simple logger
+#org.apache.commons.logging.Log = org.apache.commons.logging.impl.SimpleLog
+
+# Uncomment the next two lines if you want to use JDK 1.4 logging
+#org.apache.commons.logging.Log = org.apache.jdo.util.JDOJdk14Logger
+

Added: incubator/jdo/trunk/core20/src/conf/logging.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/conf/logging.properties?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/conf/logging.properties (added)
+++ incubator/jdo/trunk/core20/src/conf/logging.properties Sun May 22 10:44:19 2005
@@ -0,0 +1,49 @@
+#
+# Copyright 2005 The Apache Software Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at 
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software 
+# distributed under the License is distributed on an "AS IS" BASIS, 
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+# See the License for the specific language governing permissions and 
+# limitations under the License.
+
+#
+# This is a sample properties file to configure standard JDK 1.4 logging for 
+# the for the JDO2 Implementation (Core) sources.
+# Below you find an entry for each of the source logger instances. 
+# Please uncomment the line and adapt the log level to your needs, 
+# in case to want to enable a particular logger.
+#
+# The following describes the mapping between the log level of JDK 1.4 logging
+# and apache commns logging:
+#   JDK 1.4        Apache 
+#   FINEST         trace 
+#   FINE, FINER    debug 
+#   INFO, CONFIG   info
+#   WARNING        warn
+#   SEVERE         error, fatal
+#
+
+######################
+# Core source logger
+######################
+
+# JDOModel logger
+#org.apache.jdo.impl.model.jdo.level = FINE
+# XML parser logger
+#org.apache.jdo.impl.model.jdo.xml.level = FINE
+# Utility class logger
+#org.apache.jdo.util.level = FINE
+
+######################
+# JDK 1.4 logging properties
+######################
+
+handlers = java.util.logging.ConsoleHandler
+java.util.logging.ConsoleHandler.level = FINEST

Added: incubator/jdo/trunk/core20/src/conf/simplelog.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/conf/simplelog.properties?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/conf/simplelog.properties (added)
+++ incubator/jdo/trunk/core20/src/conf/simplelog.properties Sun May 22 10:44:19 2005
@@ -0,0 +1,39 @@
+#
+# Copyright 2005 The Apache Software Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at 
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software 
+# distributed under the License is distributed on an "AS IS" BASIS, 
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+# See the License for the specific language governing permissions and 
+# limitations under the License.
+
+#
+# This is a sample properties file to configure apache commons logging SimpleLog
+# implementation for the JDO2 Implementation (Core) sources. 
+# Below you find an entry for each of the source logger instances. 
+# Please uncomment the line and adapt the log level to your needs, 
+# in case to want to enable a particular logger.
+#
+
+######################
+# Core source logger
+######################
+
+# JDOModel logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo = debug
+# XML parser logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo.xml = debug
+# Utility class logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.util = debug
+
+######################
+# Default logging level
+######################
+
+org.apache.commons.logging.simplelog.defaultlog = error

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaField.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaField.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaField.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaField.java Sun May 22 10:44:19 2005
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import org.apache.jdo.model.java.JavaField;
+import org.apache.jdo.model.java.JavaType;
+import org.apache.jdo.model.jdo.JDOField;
+
+
+/**
+ * Abstract super class for JavaField implementations. 
+ * It provides getters for the name and declaringClass properties which are
+ * initialized in the constructor. The implementation of method getJDOField
+ * always returns <code>null</code>.
+ * <p>
+ * A non-abstract subclass must implement methods
+ * {@link #getModifiers()} and {@link #getType()}. Note, this
+ * implementation of method {@link #getJDOField()} always returns
+ * <code>null</code>, so a subclass may want to override this method.
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1 
+ */
+abstract public class AbstractJavaField
+    implements JavaField 
+{
+    /** The Field name. */
+    private String name;
+
+    /** The declaring class. */
+    private JavaType declaringClass;
+
+    /** 
+     * Constructor setting the name and declaringClass property.
+     * @param name field name
+     * @param declaringClass the JavaType of the class or interface that
+     * declares this JavaField.
+     */
+    public AbstractJavaField(String name, JavaType declaringClass)
+    {
+        this.name = name;
+        this.declaringClass = declaringClass;
+    }
+
+    /**
+     * Returns the name of the field. 
+     * @return field name
+     */
+    public String getName()
+    {
+        return name;
+    }
+    
+    /**
+     * Returns the Java language modifiers for the field represented by
+     * this JavaField, as an integer. The java.lang.reflect.Modifier class
+     * should be used to decode the modifiers. 
+     * @return the Java language modifiers for this JavaField
+     * @see java.lang.reflect.Modifier
+     */
+    abstract public int getModifiers();
+    
+    /**
+     * Returns the JavaType representation of the field type.
+     * @return field type
+     */
+    abstract public JavaType getType();
+
+    /**
+     * Returns the JavaType instance representing the class or interface
+     * that declares the field represented by this JavaField instance.
+     * @return the JavaType instance of the declaring class.
+     */
+    public JavaType getDeclaringClass()
+    {
+        return declaringClass;
+    }
+    
+    /**
+     * Returns the corresponding JDOField instance, if the JDOModel
+     * provides any JDO metadata for the field represented by this
+     * JavaField. If there is no corresponding JDOField representation, the
+     * method returns <code>null</code>. 
+     * <p>
+     * This implementation always returns <code>null</code>.
+     * @return the corresponding JDOField instance (if available);
+     * <code>null</code> otherwise.
+     */
+    public JDOField getJDOField()
+    {
+        return null;
+    }
+    
+    // ===== Methods not defined in JavaField =====
+
+    /**
+     * Indicates whether some other object is "equal to" this one.
+     * @param obj the reference object with which to compare. 
+     * <p>
+     * This implementation matches the declaring class and the name of the
+     * specified object to the declaring class and the name of this
+     * JavaField. 
+     * @return <code>true</code> if this object is the same as the obj
+     * argument; <code>false</code> otherwise. 
+     */
+    public boolean equals(Object obj)
+    {
+        // return true if obj is this
+        if (obj == this) return  true;
+        // return false if obj does not have the correct type
+        if ((obj == null) || !(obj instanceof JavaField)) return false;
+
+        JavaField other = (JavaField)obj;
+        // compare declaringClass and field names
+        return (getDeclaringClass() == other.getDeclaringClass())
+            && (getName().equals(other.getName()));
+    }
+    
+    /**
+     * Returns a hash code value for the object. 
+     * <p>
+     * This is computed as the exclusive-or of the hashcodes for the
+     * underlying field's declaring class name and its name.
+     * @return a hash code value for this object.
+     */
+    public int hashCode()
+    {
+        return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
+    }
+    
+    /**
+     * Returns a string representation of the object. 
+     * @return a string representation of the object.
+     */
+    public String toString()
+    {
+        return getDeclaringClass().getName() + "." + getName();
+    }
+}
+

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModel.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModel.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModel.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModel.java Sun May 22 10:44:19 2005
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.io.InputStream;
+
+import org.apache.jdo.model.ModelException;
+import org.apache.jdo.model.java.JavaModel;
+import org.apache.jdo.model.java.JavaType;
+import org.apache.jdo.model.jdo.JDOModel;
+
+
+/**
+ * Abstract super class for JavaModel implementations. 
+ * It implements the jdoModel property and the parent/child relationship
+ * between javaModels. It also provides a map of types managed by this
+ * JavaModel (see {@link #types}). The AbstractJavaModel constructor
+ * automatically adds all the predefined types to this map.
+ * <p>
+ * A non-abstract subclass must implement methods
+ * {@link #getJavaType(String name)} and 
+ * {@link #getInputStreamForResource(String resourceName)}.
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+abstract public class AbstractJavaModel
+    implements JavaModel
+{
+    /** Map of known JavaTypes. Key is the type name as a string. */
+    protected Map types;
+
+    /** The parent JavaModel. */
+    protected JavaModel parent;
+
+    /** The child JavaModels. */
+    protected Set children = new HashSet();
+
+    /** The corresponding JDOModel instance. */
+    protected JDOModel jdoModel;
+    
+    /**
+     * Constructor. It adds all predefined types to the cache of types
+     * known by this model instance.
+     * @see PredefinedType
+     */
+    protected AbstractJavaModel()
+    {
+        types = new HashMap(PredefinedType.getPredefinedTypes());
+    }
+
+    /** 
+     * The method returns the JavaType instance for the specified type
+     * name. A type name is unique within one JavaModel instance. The
+     * method returns <code>null</code> if this model instance does not
+     * know a type with the specified name.
+     * @return a JavaType instance for the specified name or
+     * <code>null</code> if not present in this model instance.
+     */
+    abstract public JavaType getJavaType(String name);
+
+    /** 
+     * The method returns the JavaType instance for the type name of the
+     * specified class object. This is a convenience method for 
+     * <code>getJavaType(clazz.getName())</code>. The major difference
+     * between this method and getJavaType taking a type name is that this 
+     * method is supposed to return a non-<code>null<code> value. The
+     * specified class object describes an existing type.
+     * @param clazz the Class instance representing the type
+     * @return a JavaType instance for the name of the specified class
+     * object.
+     */
+    public JavaType getJavaType(Class clazz)
+    {
+        return (clazz == null) ? null : getJavaType(clazz.getName());
+    }
+
+    /**
+     * Finds a resource with a given name. A resource is some data that can
+     * be accessed by class code in a way that is independent of the
+     * location of the code. The name of a resource is a "/"-separated path
+     * name that identifies the resource. The method method opens the
+     * resource for reading and returns an InputStream. It returns 
+     * <code>null</code> if no resource with this name is found or if the 
+     * caller doesn't have adequate privileges to get the resource.
+     * @param resourceName the resource name
+     * @return an input stream for reading the resource, or <code>null</code> 
+     * if the resource could not be found or if the caller doesn't have
+     * adequate privileges to get the resource. 
+     */
+    abstract public InputStream getInputStreamForResource(String resourceName);
+
+    /**
+     * Returns the parent JavaModel instance of this JavaModel.
+     * @return the parent JavaModel
+     */
+    public JavaModel getParent()
+    {
+        return parent;
+    }
+
+    /**
+     * Set the parent JavaModel for this JavaModel. The method
+     * automatically adds this JavaModel to the collection of children
+     * of the specified parent JavaModel.
+     * @param parent the parent JavaModel
+     * @exception ModelException if impossible
+     */
+    public void setParent(JavaModel parent)
+        throws ModelException
+    {
+        if (this.parent == parent) {
+            // no changes => return;
+            return;
+        }
+        if (this.parent != null) {
+            // remove this from the collection of children of the old parent
+            ((AbstractJavaModel)this.parent).children.remove(this);
+            // add this to the collection of children of the new parent
+            ((AbstractJavaModel)parent).children.add(this);
+        }
+        this.parent = parent;
+    }
+
+    /**
+     * Returns a collection of child JavaModel instances in the form
+     * of an array. All instances from the returned array have this
+     * JavaModel instance as parent.
+     * @return the child JavaModel instances
+     */
+    public JavaModel[] getChildren()
+    {
+        return (JavaModel[])children.toArray(new JavaModel[children.size()]);
+    }
+
+    /**
+     * Returns the corresponding JDOModel instance.
+     * @return the corresponding JDOModel.
+     */
+    public JDOModel getJDOModel()
+    {
+        return jdoModel;
+    }
+
+    /**
+     * Sets the corresponding JDOModel instance.
+     * @param jdoModel the JDOModel instance
+     * @exception ModelException if impossible
+     */
+    public void setJDOModel(JDOModel jdoModel)
+        throws ModelException
+    {
+        this.jdoModel = jdoModel;
+    }
+    
+}
+

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModelFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModelFactory.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModelFactory.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaModelFactory.java Sun May 22 10:44:19 2005
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import org.apache.jdo.impl.model.jdo.JDOModelFactoryImplDynamic;
+import org.apache.jdo.model.ModelException;
+import org.apache.jdo.model.ModelFatalException;
+import org.apache.jdo.model.java.JavaModel;
+import org.apache.jdo.model.java.JavaModelFactory;
+import org.apache.jdo.model.java.JavaType;
+import org.apache.jdo.model.jdo.JDOModel;
+import org.apache.jdo.model.jdo.JDOModelFactory;
+import org.apache.jdo.util.I18NHelper;
+
+/**
+ * Abstract super class for JavaModelFactory implementations. It provides a
+ * JavaModel cache and implements the JavaModel lookup method 
+ * {@link #getJavaModel(Object key)}. Any JavaModel instance returned by
+ * this method is automatically connected to its corresponding JDOModel
+ * instance.
+ * <p>
+ * A non-abstract subclass must implement method 
+ * {@link #createJavaModel(Object key)}. The lookup method calls this
+ * method if it cannot find a JavaModel instance in the cache. The method
+ * should also check whether the specified key is of an appropriate type
+ * for the JavaModelFactory implementation. A subclass should check whether
+ * it can implement method {@link #getJavaType(Object typeDesc)}. The
+ * implementation in AbstractJavaModelFactory always throws a
+ * ModelFatalException.
+ * 
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+abstract public class AbstractJavaModelFactory
+    implements JavaModelFactory
+{    
+    /**
+     * Map of JavaModel instances, key is implementation specific.
+     * @see #getJavaModel(Object key)
+     */
+    private Map modelCache = new HashMap();
+    
+    /** I18N support */
+    private static I18NHelper msg = 
+        I18NHelper.getInstance(AbstractJavaModelFactory.class);
+
+    /**
+     * Creates a new empty JavaModel instance. A factory implementation may
+     * use the specified key when caching the new JavaModel instance. 
+     * <p>
+     * Each JavaModelFactory imposes its own restrictions for the keys to
+     * cache JavaModel instances. Some implementation will allow only keys
+     * of a certain type. Some implementations will prohibit
+     * <code>null</code> keys. Attempting to use an ineligible key will
+     * result in a {@link org.apache.jdo.model.ModelException}. This means
+     * the specified key is of an inappropriate type for this
+     * JavaModelFactory or if the key is <code>null</code> and this 
+     * JavaModelFactory does not support <code>null</code> keys.
+     * @param key the key that may be used to cache the returned JavaModel instance.
+     * @return a new JavaModel instance.
+     * @exception ModelException if impossible; the key is of an
+     * inappropriate type or the key is <code>null</code> and this
+     * JavaModelFactory does not support <code>null</code> keys.
+     */
+    abstract public JavaModel createJavaModel(Object key)
+        throws ModelException;
+
+    /**
+     * Returns the JavaModel instance for the specified key.
+     * <p>
+     * The method throws a {@link org.apache.jdo.model.ModelFatalException},
+     * if the specified key is of an inappropriate type for this
+     * JavaModelFactory or if the key is <code>null</code> and this
+     * JavaModelFactory does not support <code>null</code> keys.
+     * @param key the key used to cache the returned JavaModel instance.
+     * @return a JavaModel instance for the specified key.
+     * @exception ModelFatalException the key is of an inappropriate type
+     * or the key is <code>null</code> and this JavaModelFactory does not
+     * support <code>null</code> keys.
+     */
+    public JavaModel getJavaModel(Object key)
+    {
+        synchronized (this.modelCache) {
+            JavaModel javaModel = (JavaModel)modelCache.get(key);
+            if (javaModel == null) {
+                // create new model and store it using the specified key
+                try {
+                    javaModel = createJavaModel(key);
+                    modelCache.put(key, javaModel);
+                }
+                catch (ModelException ex) {
+                    throw new ModelFatalException(
+                        "EXC_CannotCreateJavaModel", ex); //NOI18N
+                }
+            } 
+            return javaModel;
+         }
+    }
+
+    /**
+     * Returns a JavaType instance for the specified type description
+     * (optional operation). This method is a convenience method and a
+     * short cut for <code>getJavaModel(key).getJavaType(typeName)</code>. 
+     * If the factory supports this method, it needs to be able to get the
+     * key for the JavaModel lookup and the type name for the JavaType
+     * lookup from the specified typeDesc. An example for such a type
+     * description is the java.lang.Class instance in the runtime
+     * environment. 
+     * <p>
+     * The method throws a {@link org.apache.jdo.model.ModelFatalException}, 
+     * if this factory does not support this short cut or if it does not
+     * support the specified type description.
+     * <p>
+     * This implementation always throws a ModelFatalException.
+     * @param typeDesc the type description.
+     * @return a JavaType instance for the specified type.
+     * @exception ModelFatalException this factory does not support this
+     * short cut or does not support the specified type description.
+     */
+    public JavaType getJavaType(Object typeDesc)
+    {
+        throw new ModelFatalException(msg.msg(
+            "EXC_MethodNotSupported", this.getClass().getName(), //NOI18N
+            "getJavaType")); //NOI18N
+    }
+    
+}
+

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/AbstractJavaType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import org.apache.jdo.model.java.JavaField;
+import org.apache.jdo.model.java.JavaType;
+import org.apache.jdo.model.jdo.JDOClass;
+
+
+/**
+ * Abstract super class for JavaType implementations. It provides a
+ * default implementation for all methods except getName. The methods return
+ * the Java default value of the return type. 
+ * <p>
+ * A non-abstract subclass must implement method {@link #getName()} and
+ * needs to override any of the other methods where the default
+ * implementation is not appropriate.
+ * <p>
+ * Note, the class implements methods {@link #equals(Object obj)},
+ * {@link #hashCode()} and {@link #toString()}using the name of a JavaType.
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+abstract public class AbstractJavaType
+    implements JavaType 
+{
+    public boolean isPrimitive() { return false; }
+    public boolean isIntegral()  { return false; }
+    public boolean isFloatingPoint() { return false; }
+    public boolean isInterface()  { return false; }
+    public boolean isArray()      { return false; }
+    public boolean isWrapperClass() { return false; }
+    public boolean isJDOSupportedCollection() { return false; }
+    public boolean isJDOSupportedMap() { return false; }
+    public boolean isTrackable()  { return false; }
+    public boolean isValue() { return false; }
+    public boolean isOrderable() { return false; }
+    public boolean isPersistenceCapable() { return false; }
+    public boolean isCompatibleWith(JavaType javaType) { return false; }
+    abstract public String getName();
+    public int getModifiers() { return 0; }
+    public JavaType getSuperclass() { return null; }
+    public JDOClass getJDOClass() { return null; }
+    public JavaType getArrayComponentType() { return null; }
+    public JavaField getJavaField(String name) { return null; }
+    
+    // ===== Methods not defined in JavaType =====
+
+    /**
+     * Indicates whether some other object is "equal to" this one.
+     * @param obj the reference object with which to compare. 
+     * <p>
+     * This implementation compares the name of the specified object to be
+     * equal to the name of this JavaType.
+     * this 
+     * @return <code>true</code> if this object is the same as the obj
+     * argument; <code>false</code> otherwise. 
+     */
+    public boolean equals(Object obj)
+    {
+        // return true if obj is this
+        if (obj == this) return  true;
+        // return false if obj does not have the correct type
+        if ((obj == null) || !(obj instanceof JavaType)) return false;
+
+        JavaType other = (JavaType)obj;
+        // compare names
+        String name = getName();
+        if (name == null) return other.getName() == null;
+        return name.equals(other.getName());
+    }
+    
+    /**
+     * Returns a hash code value for the object. 
+     * <p>
+     * This implementation returns the hashCode of the name of this
+     * JavaType. 
+     * @return a hash code value for this object.
+     */
+    public int hashCode()
+    {
+        String name = getName();
+        return (name == null) ? 0 : name.hashCode();
+    }
+    
+    /**
+     * Returns a string representation of the object. 
+     * @return a string representation of the object.
+     */
+    public String toString()
+    {
+        return getName();
+    }
+    
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaField.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaField.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaField.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaField.java Sun May 22 10:44:19 2005
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.lang.reflect.Field;
+
+import org.apache.jdo.impl.model.java.AbstractJavaField;
+import org.apache.jdo.model.ModelFatalException;
+import org.apache.jdo.model.java.JavaField;
+import org.apache.jdo.model.java.JavaType;
+import org.apache.jdo.model.jdo.JDOField;
+import org.apache.jdo.util.I18NHelper;
+
+/**
+ * This class provides a basic JavaField implementation using a reflection
+ * Field instance. The implementation supports lazy initialization of the
+ * wrapped reflection field instance (see 
+ * {@link #BaseReflectionJavaField(String fieldName, JavaType declaringClass)}.
+ * <p>
+ * Note, this implementation is not connected to a JavaModelFactory, thus
+ * it can only support predefined types as field types.
+ * @see PredefinedType
+ * @author Michael Bouschen
+ * @since JDO 1.1
+ */
+public class BaseReflectionJavaField
+    extends AbstractJavaField
+{
+    /** The wrapped java.lang.reflect.Field instance. */
+    private Field field;
+
+    /** The type of the field. */
+    protected JavaType type;
+
+    /** I18N support */
+    private final static I18NHelper msg = 
+        I18NHelper.getInstance(BaseReflectionJavaField.class);
+
+    /** 
+     * Constructor taking a reflection field representation. The specifie
+     * field must not be <code>null</code>. 
+     * @param field the java.lang.reflect.Field instance
+     * @param declaringClass the JavaType of the declaring class or interface.
+     */
+    protected BaseReflectionJavaField(Field field, JavaType declaringClass)
+    {
+        super((field == null) ? null : field.getName(), declaringClass);
+        if (field == null)
+            throw new ModelFatalException(msg.msg(
+                "ERR_InvalidNullFieldInstance", "BaseReflectionJavaField.<init>")); //NOI18N
+        this.field = field;
+    }
+    
+    /** 
+     * Constructor taking the field name. This constructor allows lazy
+     * initialization of the field reference. 
+     * @param fieldName the name of the field.
+     * @param declaringClass the JavaType of the declaring class or interface.
+     */
+    protected BaseReflectionJavaField(String fieldName, JavaType declaringClass)
+    {
+        super(fieldName, declaringClass);
+    }
+
+    /**
+     * Returns the Java language modifiers for the field represented by
+     * this JavaField, as an integer. The java.lang.reflect.Modifier class
+     * should be used to decode the modifiers. 
+     * @return the Java language modifiers for this JavaField
+     * @see java.lang.reflect.Modifier
+     */
+    public int getModifiers()
+    {
+        ensureInitializedField();
+        return field.getModifiers();
+    }
+
+    /**
+     * Returns the JavaType representation of the field type.
+     * @return field type
+     */
+    public JavaType getType()
+    {
+        if (type == null) {
+            ensureInitializedField();
+            String typeName = field.getType().getName();
+            // Note, this only checks for predefined types!
+            type = PredefinedType.getPredefinedType(typeName);
+        }
+        return type;
+    }
+    
+    // ===== Methods not defined in JavaField =====
+
+    /** 
+     * Returns the java.lang.reflect.Field that is wrapped by this
+     * JavaField.
+     * @return the java.lang.reflect.Field instance.
+     */
+    protected Field getField()
+    {
+        ensureInitializedField();
+        return this.field;
+    }
+
+    /**
+     * Helper method to retrieve the java.lang.reflect.Field for this
+     * JavaField.
+     * @param clazz the Class instance of the declaring class or interface
+     * @param fieldName the field name
+     */
+    public static Field getDeclaredFieldPrivileged(final Class clazz, 
+                                                   final String fieldName)
+    {
+        if ((clazz == null) || (fieldName == null))
+            return null;
+
+        return (Field) AccessController.doPrivileged(
+            new PrivilegedAction() {
+                public Object run () {
+                    try {
+                        return clazz.getDeclaredField(fieldName);
+                    }
+                    catch (SecurityException ex) {
+                        throw new ModelFatalException(
+                            msg.msg("EXC_CannotGetDeclaredField", //NOI18N
+                                    clazz.getName()), ex); 
+                    }
+                    catch (NoSuchFieldException ex) {
+                        return null; // do nothing, just return null
+                    }
+                    catch (LinkageError ex) {
+                        throw new ModelFatalException(msg.msg(
+                           "EXC_ClassLoadingError", clazz.getName(), //NOI18N
+                           ex.toString()));
+                    }
+                }
+            }
+            );
+    }
+
+    // ===== Internal helper methods =====
+    
+    /**
+     * This method makes sure the reflection field is set.
+     */
+    protected void ensureInitializedField()
+    {
+        if (this.field == null) {
+            this.field = getDeclaredFieldPrivileged(
+                ((BaseReflectionJavaType)getDeclaringClass()).getJavaClass(),
+                getName());
+            if (field == null) {
+                throw new ModelFatalException(msg.msg(
+                    "ERR_MissingFieldInstance", //NOI18N
+                    "BaseReflectionJavaField.ensureInitializedField", getName())); //NOI18N
+            }
+        }
+    }
+
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/BaseReflectionJavaType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import java.lang.reflect.Field;
+
+import org.apache.jdo.model.ModelFatalException;
+import org.apache.jdo.model.java.JavaField;
+import org.apache.jdo.model.java.JavaType;
+import org.apache.jdo.util.I18NHelper;
+
+
+
+/**
+ * This class provides a basic JavaType implementation using a reflection
+ * Class instance.
+ * <p> 
+ * Note, BaseReflectionJavaType must not be used for array types, since it inherits
+ * the default implemention of methods isArray and getArrayComponentType
+ * from its superclass AbstractJavaType.
+ * 
+ * @author Michael Bouschen
+ * @since JDO 1.1
+ */
+public class BaseReflectionJavaType
+    extends AbstractJavaType
+{
+    /** The java.lang.Class instance for this BaseReflectionJavaType. */
+    protected Class clazz;
+
+    /** The superclass JavaType. */
+    protected JavaType superclass;
+
+    /** I18N support */
+    private static I18NHelper msg = 
+        I18NHelper.getInstance(BaseReflectionJavaType.class);
+
+    /**
+     * Constructor. The specified java.lang.Class instance must not be
+     * <code>null</code>. The 
+     * @param clazz the Class instance representing the type
+     * @param superclass JavaType instance representing the superclass.
+     */
+    public BaseReflectionJavaType(Class clazz, JavaType superclass)
+    {
+        if (clazz == null)
+            throw new ModelFatalException(msg.msg(
+                "ERR_InvalidNullClassInstance", "BaseReflectionJavaType.<init>")); //NOI18N
+        this.clazz = clazz;
+        this.superclass = superclass;
+    }
+    
+    /** 
+     * Determines if this JavaType object represents an interface type.
+     * @return <code>true</code> if this object represents an interface type; 
+     * <code>false</code> otherwise.
+     */
+    public boolean isInterface()
+    {
+        return clazz.isInterface();
+    }
+    
+    /** 
+     * Returns true if this JavaType is compatible with the specified
+     * JavaType. 
+     * @param javaType the type this JavaType is checked with.
+     * @return <code>true</code> if this is compatible with the specified
+     * type; <code>false</code> otherwise.
+     */
+    public boolean isCompatibleWith(JavaType javaType)
+    {
+        if (javaType == null)
+            return false;
+        
+        if (javaType instanceof BaseReflectionJavaType) {
+            BaseReflectionJavaType otherType = (BaseReflectionJavaType)javaType;
+            return otherType.getJavaClass().isAssignableFrom(clazz);
+        }
+        
+        return false;
+    }
+
+    /**
+     * Returns the name of the type. If this type represents a class or
+     * interface, the name is fully qualified.
+     * @return type name
+     */
+    public String getName()
+    {
+        return clazz.getName();
+    }
+
+    /**
+     * Returns the Java language modifiers for the field represented by
+     * this JavaType, as an integer. The java.lang.reflect.Modifier class
+     * should be used to decode the modifiers. 
+     * @return the Java language modifiers for this JavaType
+     */
+    public int getModifiers() 
+    { 
+        return clazz.getModifiers(); 
+    }
+
+    /** 
+     * Returns the JavaType representing the superclass of the entity
+     * represented by this JavaType. If this JavaType represents either the 
+     * Object class, an interface, a primitive type, or <code>void</code>, 
+     * then <code>null</code> is returned. If this object represents an
+     * array class then the JavaType instance representing the Object class
+     * is returned.  
+     * @return the superclass of the class represented by this JavaType.
+     */
+    public JavaType getSuperclass()
+    {
+        return superclass;
+    }
+
+    /**
+     * Returns a JavaField instance that reflects the field with the
+     * specified name of the class or interface represented by this
+     * JavaType instance. The method returns <code>null</code>, if the
+     * class or interface (or one of its superclasses) does not have a
+     * field with that name.
+     * @param fieldName the name of the field 
+     * @return the JavaField instance for the specified field in this class
+     * or <code>null</code> if there is no such field.
+     */
+    public JavaField getJavaField(String fieldName) 
+    { 
+        Field field = 
+            BaseReflectionJavaField.getDeclaredFieldPrivileged(clazz, fieldName);
+        if (field != null) {
+            return new BaseReflectionJavaField(field, this);
+        }
+        
+        // check superclass, if available and other than Object
+        JavaType superclass = getSuperclass();
+        if ((superclass != null) && (superclass != PredefinedType.objectType)) {
+            return superclass.getJavaField(fieldName);
+        }
+        
+        return null;
+    }
+
+    // ===== Methods not defined in JavaType =====
+
+    /**
+     * Returns the java.lang.Class instance wrapped by this JavaType.
+     * @return the Class instance for this JavaType.
+     */
+    public Class getJavaClass()
+    {
+        return clazz;
+    }
+
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/Bundle.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/Bundle.properties?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/Bundle.properties (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/Bundle.properties Sun May 22 10:44:19 2005
@@ -0,0 +1,56 @@
+#
+# Copyright 2005 The Apache Software Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at 
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software 
+# distributed under the License is distributed on an "AS IS" BASIS, 
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+# See the License for the specific language governing permissions and 
+# limitations under the License.
+
+#
+# Generic messages
+#
+
+# {0} - location (class.method)
+#NOI18N
+ERR_InvalidNullFieldInstance={0}: specified Field instance is null.
+
+
+# {0} - class name
+# {1} - detailed message of the cause
+EXC_ClassLoadingError=Error during loading of class ''{0}'': {1}.
+
+#
+# ReflectionJavaType
+#
+
+# {0} - error location (class.method)
+#NOI18N
+ERR_InvalidNullClassInstance={0}: specified Class instance is null.
+
+#
+# BaseReflectionJavaField
+#
+# {0} - class name
+EXC_CannotGetDeclaredField=A SecurityException was thrown when trying to \
+get a declared field of class ''{0}''.  You must grant \
+java.lang.RuntimePermission("accessDeclaredMembers") to the codeBase \
+containing the JDO Reference Implementation (jdori.jar).
+
+#NOI18N
+ERR_MissingFieldInstance={0}: cannot find reflection field instance for field {1}.
+
+#
+# AbstractJavaModelFactory
+#
+
+# {0} - class name
+# {1} - method name
+EXC_MethodNotSupported=Class {0} does not support method {1}.
+

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/ErrorType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/ErrorType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/ErrorType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/ErrorType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import org.apache.jdo.model.java.JavaType;
+
+/**
+ * An instance of class ErrorType represents an erroneous type. Components
+ * such as the semantic analysis may use this type to indicate an error
+ * situtaion. It is compatible to all other types. 
+ * 
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+public class ErrorType
+    extends AbstractJavaType
+{
+    /** The singleton ErrorType instance. */
+    public static final ErrorType errorType = new ErrorType();
+
+    /** 
+     * Creates new a ErrorType instance. This constructor should not be 
+     * called directly; instead, the singleton instance  {@link #errorType}
+     * should be used. 
+     */
+    protected ErrorType() {}
+
+    /** 
+     * Returns true if this JavaType is compatible with the specified
+     * JavaType. This implementation always returns <code>true</code>,
+     * because ErrorType is compatible with any other type.
+     * @param javaType the type this JavaType is checked with.
+     * @return <code>true</code> if this is compatible with the specified
+     * type; <code>false</code> otherwise.
+     */
+    public boolean isCompatibleWith(JavaType javaType)
+    {
+        return true;
+    }
+    
+    /** 
+     * Returns the name of the type.  
+     * @return type name
+     */
+    public String getName()
+    {
+        return "<error type>";
+    }
+
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/FloatingPointType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/FloatingPointType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/FloatingPointType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/FloatingPointType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+/**
+ * A FloatingPointType instance represents a floating point type as defined
+ * in the Java language. There are two floating point types: 
+ * <code>float</code> and <code>double</code>.
+ * <p>
+ * Class PredefinedType provides public static final variables referring
+ * to the JavaType representation for floating point types.
+ * 
+ * @see PredefinedType#floatType
+ * @see PredefinedType#doubleType
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+public class FloatingPointType
+    extends PrimitiveType 
+{
+    /** Constructor. */
+    public FloatingPointType(Class clazz)
+    {
+        super(clazz);
+    }
+
+    /** 
+     * Returns <code>true</code> if this JavaType represents a floating
+     * point type. 
+     * @return <code>true</code> if this JavaType represents a floating
+     * point type; <code>false</code> otherwise.
+     */
+    public boolean isFloatingPoint() 
+    {
+        return true;
+    }
+
+    /**
+     * Returns <code>true</code> if this JavaType represents an orderable
+     * type as specified by JDO.
+     * @return <code>true</code> if this JavaType represents an orderable
+     * type; <code>false</code> otherwise.
+     */
+    public boolean isOrderable() 
+    {
+        return true;
+    }
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/IntegralType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/IntegralType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/IntegralType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/IntegralType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+/**
+ * A IntegralType instance represents an integral type as defined in the
+ * Java language. There are five are integral types: <code>byte</code>, 
+ * <code>short</code>, <code>int</code>, <code>long</code>, and
+ * <code>char</code>.
+ * <p>
+ * Class PredefinedType provides public static final variables referring
+ * to the JavaType representation for integral types.
+ *
+ * @see PredefinedType#byteType
+ * @see PredefinedType#shortType
+ * @see PredefinedType#intType
+ * @see PredefinedType#longType
+ * @see PredefinedType#charType
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+public class IntegralType
+    extends PrimitiveType 
+{
+    /** Constructor. */
+    public IntegralType(Class clazz)
+    {
+        super(clazz);
+    }
+    
+    /**
+     * Returns <code>true</code> if this JavaType represents an integral
+     * type. 
+     * @return <code>true</code> if this JavaTypre represents an integral
+     * type; <code>false</code> otherwise.
+     */
+    public boolean isIntegral() 
+    {
+        return true;
+    }
+
+    /**
+     * Returns <code>true</code> if this JavaType represents an orderable
+     * type as specified by JDO.
+     * @return <code>true</code> if this JavaType represents an orderable
+     * type; <code>false</code> otherwise.
+     */
+    public boolean isOrderable() 
+    {
+        return true;
+    }
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedCollectionType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedCollectionType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedCollectionType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedCollectionType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import org.apache.jdo.model.java.JavaType;
+
+/**
+ * A JDOSupportedCollectionType instance represents a JDO supported
+ * collection type. 
+ * <p>
+ * Class PredefinedType provides public static final variables referring
+ * to the JavaType representation for JDO supported map types.
+ * 
+ * @see PredefinedType#collectionType
+ * @see PredefinedType#setType
+ * @see PredefinedType#listType
+ * @see PredefinedType#hashSetType 
+ * @see PredefinedType#treeSetType
+ * @see PredefinedType#arrayListType
+ * @see PredefinedType#linkedListType
+ * @see PredefinedType#vectorType
+ * @see PredefinedType#stackType
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+public class JDOSupportedCollectionType
+    extends PredefinedType
+{
+    /** 
+     * Constructor for JDOSupportedCollection types having no superclass. 
+     * These are the collection interfaces among the JDO supported 
+     * collection types. 
+     * @param clazz the Class instance representing the type.
+     */
+    public JDOSupportedCollectionType(Class clazz)
+    {
+        super(clazz);
+    }
+
+    /** 
+     * Constructor for JDOSupportedCollection types having a superclass. 
+     * These are the collection implemenatation classes among the JDO 
+     * supported collection types. 
+     * @param clazz the Class instance representing the type
+     * @param superclass JavaType instance representing the superclass.
+     */
+    public JDOSupportedCollectionType(Class clazz, JavaType superclass)
+    {
+        super(clazz, superclass);
+    }
+
+    /** 
+     * Returns <code>true</code> if this JavaType represents a JDO
+     * supported collection type. The JDO specification allows the
+     * following collection interfaces and classes as types of persistent 
+     * fields (see section 6.4.3 Persistent fields):
+     * @return <code>true</code> if this JavaType represents a JDO
+     * supported collection; <code>false</code> otherwise.
+     */
+    public boolean isJDOSupportedCollection() 
+    {
+        return true;
+    }
+
+    /**
+     * Returns <code>true</code> if this JavaType represents a trackable
+     * Java class. A JDO implementation may replace a persistent field of
+     * a trackable type with an assignment compatible instance of its own
+     * implementation of this type which notifies the owning FCO of any
+     * change of this field. 
+     * @return <code>true</code> if this JavaType represents a trackable
+     * Java class, <code>false</code> otherwise.
+     */
+    public boolean isTrackable()
+    {
+        return true;
+    }
+    
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedMapType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedMapType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedMapType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JDOSupportedMapType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import org.apache.jdo.model.java.JavaType;
+
+/**
+ * A JDOSupportedMapType instance represents a JDO supported map type. 
+ * <p>
+ * Class PredefinedType provides public static final variables referring
+ * to the JavaType representation for JDO supported map types.
+ *
+ * @see PredefinedType#mapType
+ * @see PredefinedType#hashMapType
+ * @see PredefinedType#hashtableType
+ * @see PredefinedType#propertiesType
+ * @see PredefinedType#treeMapType
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+public class JDOSupportedMapType
+    extends PredefinedType
+{
+    /** 
+     * Constructor for JDOSupportedMap types having no superclass. This is
+     * the map interface among the JDO supported map types.
+     * @param clazz the Class instance representing the type
+     */
+    public JDOSupportedMapType(Class clazz)
+    {
+        super(clazz);
+    }
+
+    /** 
+     * Constructor for JDOSupportedMap types having a superclass. These are
+     * the map implemenatation classes among the JDO supported map types.
+     * @param clazz the Class instance representing the type
+     * @param superclass JavaType instance representing the superclass.
+     */
+    public JDOSupportedMapType(Class clazz, JavaType superclass)
+    {
+        super(clazz, superclass);
+    }
+
+    /** 
+     * Returns <code>true</code> if this JavaType represents a JDO
+     * supported map type. The JDO specification allows the
+     * following map interfaces and classes as types of persistent 
+     * fields (see section 6.4.3 Persistent fields):
+     * @return <code>true</code> if this JavaTypre represents a JDO
+     * supported map; <code>false</code> otherwise.
+     */
+    public boolean isJDOSupportedMap() 
+    {
+        return true;
+    }
+
+    /**
+     * Returns <code>true</code> if this JavaType represents a trackable
+     * Java class. A JDO implementation may replace a persistent field of
+     * a trackable type with an assignment compatible instance of its own
+     * implementation of this type which notifies the owning FCO of any
+     * change of this field. 
+     * @return <code>true</code> if this JavaType represents a trackable
+     * Java class, <code>false</code> otherwise.
+     */
+    public boolean isTrackable()
+    {
+        return true;
+    }
+    
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JavaModel-Impl.jpg
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JavaModel-Impl.jpg?rev=171348&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/JavaModel-Impl.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/MutableValueClassType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/MutableValueClassType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/MutableValueClassType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/MutableValueClassType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import org.apache.jdo.model.java.JavaType;
+
+/**
+ * A MutableValueClassType instance represents a mutable class whoses
+ * values may be treated as values rather than refernces during
+ * storing. Note, MutableValueClassType instances are trackable which is
+ * the only difference in behavior to instances of the superclass
+ * ValueClassType. 
+ * <p>
+ * Class PredefinedType provides public static final variables referring
+ * to the JavaType representation for mutable value class types.
+ * 
+ * @see PredefinedType#dateType
+ * @see PredefinedType#sqlDateType
+ * @see PredefinedType#sqlTimeType 
+ * @see PredefinedType#sqlTimestampType
+ * @see PredefinedType#bitsetType
+ *
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+public class MutableValueClassType
+    extends ValueClassType
+{
+    /** 
+     * Constructor.
+     * @param clazz the Class instance representing the type
+     * @param superclass JavaType instance representing the superclass.
+     * @param orderable flag indicating whether this type is orderable.
+     */
+    public MutableValueClassType(Class clazz, JavaType superclass, boolean orderable)
+    {
+        super(clazz, superclass, orderable);
+    }
+
+    /** 
+     * Returns <code>true</code> if this JavaType represents a trackable
+     * Java class. A JDO implementation may replace a persistent field of
+     * a trackable type with an assignment compatible instance of its own
+     * implementation of this type which notifies the owning FCO of any
+     * change of this field.
+     * @return <code>true</code> if this JavaType represents a trackable
+     * Java class, <code>false</code> otherwise.
+     */
+    public boolean isTrackable() 
+    {
+        return true;
+    }
+}

Added: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/NullType.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/NullType.java?rev=171348&view=auto
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/NullType.java (added)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/java/NullType.java Sun May 22 10:44:19 2005
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.impl.model.java;
+
+import org.apache.jdo.model.java.JavaType;
+
+/**
+ * An instance of class NullType represents the type of the null expression
+ * in Java. It is compatible to all reference types.
+ * 
+ * @author Michael Bouschen
+ * @since JDO 1.0.1
+ */
+public class NullType
+    extends AbstractJavaType
+{
+    /** The singleton NullType instance. */
+    public static final NullType nullType = new NullType();
+
+    /** 
+     * Creates new a NullType instance. This constructor should not be 
+     * called directly; instead, the singleton instance  {@link #nullType}
+     * should be used. 
+     */
+    protected NullType() {}
+
+    /** 
+     * Returns true if this JavaType is compatible with the specified
+     * JavaType. This implementation returns <code>true</code>, if the
+     * specified javaType is a not a primitive type, because the type of
+     * null is compatiple with all reference types.
+     * @param javaType the type this JavaType is checked with.
+     * @return <code>true</code> if this is compatible with the specified
+     * type; <code>false</code> otherwise.
+     */
+    public boolean isCompatibleWith(JavaType javaType)
+    {
+        return !javaType.isPrimitive();
+    }
+    
+    /** 
+     * Returns the name of the type.  
+     * @return type name
+     */
+    public String getName()
+    {
+        return "<null type>";
+    }
+
+}



Mime
View raw message