You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2005/04/17 21:51:32 UTC

svn commit: r161689 - jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/registry/PolymorphicReferenceResolver.java

Author: rdonkin
Date: Sun Apr 17 12:51:32 2005
New Revision: 161689

URL: http://svn.apache.org/viewcvs?view=rev&rev=161689
Log:
Added support for polymorphic elements. Contributed by Thomas Dudziak. Bugzilla issue #34443.

Added:
    jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/registry/PolymorphicReferenceResolver.java

Added: jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/registry/PolymorphicReferenceResolver.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/registry/PolymorphicReferenceResolver.java?view=auto&rev=161689
==============================================================================
--- jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/registry/PolymorphicReferenceResolver.java (added)
+++ jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/registry/PolymorphicReferenceResolver.java Sun Apr 17 12:51:32 2005
@@ -0,0 +1,42 @@
+/*
+ * 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.commons.betwixt.registry;
+
+import org.apache.commons.betwixt.io.read.ElementMapping;
+import org.apache.commons.betwixt.io.read.ReadContext;
+
+/**
+ * <p>Resolves polymorphic references.
+ * </p><p>
+ * A polymorphic reference is an element whose name and type
+ * resolution are postponed till bind-time.
+ * When the xml is read, the type can then resolved from 
+ * by calling {@link #resolveType}.
+ * </p>
+ * @author <a href='http://jakarta.apache.org/'>Jakarta Commons Team</a>
+ */
+public interface PolymorphicReferenceResolver {
+
+    /**
+     * Resolves the bind-time type of a polymorphic element.
+     * @param descriptor <code>ElementMapping</code> describing the (polymorphic) element being mapped,
+     * not null
+     * @param context <code>ReadContext</code>, not null
+     * @return the <code>Class</code> describing the type to which this element should be bound,
+     * or null if the reference cannot be resolved
+     */
+    public Class resolveType(ElementMapping mapping, ReadContext context);
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org