From c70b70b30f95f27bd7352b0eb92b79b39444662a Mon Sep 17 00:00:00 2001 From: "David J. Wisneski" Date: Tue, 24 Jul 2007 19:51:19 +0000 Subject: [PATCH] OPENJPA-240 XMLMapping Query - rename XMLMapping interface to XMLMetaData Help Catalina committing changes for renaming classes, part 2. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@559179 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/jdbc/meta/XMLMappingRepository.java | 14 +++++++------- .../apache/openjpa/meta/XMLClassMetaData.java | 10 +++++----- .../openjpa/jdbc/kernel/exps/ConstPath.java | 8 ++++---- .../jdbc/kernel/exps/EndsWithExpression.java | 4 ++-- .../openjpa/jdbc/kernel/exps/FilterValue.java | 4 ++-- .../jdbc/kernel/exps/FilterValueImpl.java | 4 ++-- .../apache/openjpa/jdbc/kernel/exps/PCPath.java | 16 ++++++++-------- .../jdbc/kernel/exps/StartsWithExpression.java | 6 +++--- .../kernel/exps/AbstractExpressionBuilder.java | 6 +++--- .../openjpa/kernel/exps/CandidatePath.java | 8 ++++---- .../org/apache/openjpa/kernel/exps/Path.java | 8 ++++---- .../apache/openjpa/meta/MetaDataRepository.java | 2 +- .../apache/openjpa/meta/XMLFieldMetaData.java | 4 ++-- .../meta/{XMLMapping.java => XMLMetaData.java} | 4 ++-- 14 files changed, 49 insertions(+), 49 deletions(-) rename openjpa-kernel/src/main/java/org/apache/openjpa/meta/{XMLMapping.java => XMLMetaData.java} (96%) diff --git a/openjpa-jdbc-5/src/main/java/org/apache/openjpa/jdbc/meta/XMLMappingRepository.java b/openjpa-jdbc-5/src/main/java/org/apache/openjpa/jdbc/meta/XMLMappingRepository.java index f2cadb8b6..819c80788 100644 --- a/openjpa-jdbc-5/src/main/java/org/apache/openjpa/jdbc/meta/XMLMappingRepository.java +++ b/openjpa-jdbc-5/src/main/java/org/apache/openjpa/jdbc/meta/XMLMappingRepository.java @@ -23,7 +23,7 @@ import java.util.Map; import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.meta.XMLClassMetaData; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; /** * Repository of object/relational mapping information. @@ -34,7 +34,7 @@ import org.apache.openjpa.meta.XMLMapping; */ public class XMLMappingRepository extends MappingRepository { // xml mapping - protected final XMLMapping[] EMPTY_XMLMETAS; + protected final XMLMetaData[] EMPTY_XMLMETAS; private final Map _xmlmetas = new HashMap(); public XMLMappingRepository() { @@ -49,7 +49,7 @@ public class XMLMappingRepository extends MappingRepository { return meta; } - public XMLMapping getXMLClassMetaData(Class cls) { + public XMLMetaData getXMLClassMetaData(Class cls) { synchronized(_xmlmetas) { if (_xmlmetas.isEmpty()) return null; @@ -58,8 +58,8 @@ public class XMLMappingRepository extends MappingRepository { } } - public XMLMapping getXMLMetaData(FieldMetaData fmd) { - XMLMapping xmlmeta = null; + public XMLMetaData getXMLMetaData(FieldMetaData fmd) { + XMLMetaData xmlmeta = null; if (XMLClassMetaData.isXMLMapping(fmd.getDeclaredType())) { xmlmeta = getXMLClassMetaData(fmd.getDeclaredType()); if (xmlmeta == null) @@ -68,7 +68,7 @@ public class XMLMappingRepository extends MappingRepository { return xmlmeta; } - public synchronized void addXMLClassMetaData(Class cls, XMLMapping meta) { + public synchronized void addXMLClassMetaData(Class cls, XMLMetaData meta) { _xmlmetas.put(cls, meta); } @@ -76,7 +76,7 @@ public class XMLMappingRepository extends MappingRepository { return new XMLClassMetaData(fmd.getDeclaredType(), name, this); } - protected XMLMapping[] newXMLClassMetaDataArray(int length) { + protected XMLMetaData[] newXMLClassMetaDataArray(int length) { return new XMLClassMetaData[length]; } } diff --git a/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java b/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java index e3b79dd59..cb1ecd626 100644 --- a/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java +++ b/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java @@ -32,7 +32,7 @@ import javax.xml.bind.annotation.XmlType; import org.apache.openjpa.jdbc.meta.XMLMappingRepository; import org.apache.openjpa.meta.JavaTypes; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; import org.apache.openjpa.meta.XMLFieldMetaData; import org.apache.commons.lang.StringUtils; @@ -44,7 +44,7 @@ import org.apache.commons.lang.StringUtils; * @author Catalina Wei * @since 1.0.0 */ -public class XMLClassMetaData implements XMLMapping +public class XMLClassMetaData implements XMLMetaData { private Class _type; private int _code = JavaTypes.OBJECT; @@ -153,8 +153,8 @@ public class XMLClassMetaData implements XMLMapping return false; } - public XMLMapping getFieldMapping(String name) { - return (XMLMapping) _fieldMap.get(name); + public XMLMetaData getFieldMapping(String name) { + return (XMLMetaData) _fieldMap.get(name); } public void setType(Class type) { @@ -193,7 +193,7 @@ public class XMLClassMetaData implements XMLMapping for (int i = 0; i < members.length; i++) { Member member = members[i]; AnnotatedElement el = (AnnotatedElement) member; - XMLMapping field = null; + XMLMetaData field = null; if (el.getAnnotation(XmlElement.class) != null) { String xmlname = el.getAnnotation(XmlElement.class).name(); // avoid JAXB XML bind default name diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ConstPath.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ConstPath.java index a9caf53c2..dadb17e5a 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ConstPath.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ConstPath.java @@ -31,7 +31,7 @@ import org.apache.openjpa.kernel.OpenJPAStateManager; import org.apache.openjpa.kernel.exps.ExpressionVisitor; import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.FieldMetaData; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; import org.apache.openjpa.util.InternalException; /** @@ -206,13 +206,13 @@ class ConstPath } } - public void get(FieldMetaData fmd, XMLMapping meta) { + public void get(FieldMetaData fmd, XMLMetaData meta) { } - public void get(XMLMapping meta, String name) { + public void get(XMLMetaData meta, String name) { } - public XMLMapping getXmlMapping() { + public XMLMetaData getXmlMapping() { return null; } } diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EndsWithExpression.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EndsWithExpression.java index 76eea6413..74d766a85 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EndsWithExpression.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EndsWithExpression.java @@ -28,7 +28,7 @@ import org.apache.openjpa.jdbc.sql.DBDictionary; import org.apache.openjpa.jdbc.sql.SQLBuffer; import org.apache.openjpa.jdbc.sql.Select; import org.apache.openjpa.kernel.exps.ExpressionVisitor; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; /** * Test if one string ends with another. @@ -200,7 +200,7 @@ class EndsWithExpression return null; } - public XMLMapping getXmlMapping() { + public XMLMetaData getXmlMapping() { return null; } } diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValue.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValue.java index a4e797edd..a2a63f4d7 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValue.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValue.java @@ -23,7 +23,7 @@ import org.apache.openjpa.jdbc.meta.FieldMapping; import org.apache.openjpa.jdbc.schema.Column; import org.apache.openjpa.jdbc.schema.Table; import org.apache.openjpa.jdbc.sql.SQLBuffer; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; /** * The simplified public view of any non-operator in a query filter, @@ -115,5 +115,5 @@ public interface FilterValue { * If this is an XPath, return XML mapping metadata, * else return null; */ - public XMLMapping getXmlMapping(); + public XMLMetaData getXmlMapping(); } diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValueImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValueImpl.java index bdc84db9e..bfa10db61 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValueImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/FilterValueImpl.java @@ -24,7 +24,7 @@ import org.apache.openjpa.jdbc.schema.Column; import org.apache.openjpa.jdbc.schema.Table; import org.apache.openjpa.jdbc.sql.SQLBuffer; import org.apache.openjpa.jdbc.sql.Select; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; /** * Implementation of {@link FilterValue} that wraps a {@link Val}. @@ -107,7 +107,7 @@ class FilterValueImpl return null; } - public XMLMapping getXmlMapping() { + public XMLMetaData getXmlMapping() { return (getXPath() == null) ? null : getXPath().getXmlMapping(); } } diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java index 47f721aef..957b3e46c 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java @@ -40,7 +40,7 @@ import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.meta.JavaTypes; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; import org.apache.openjpa.util.UserException; /** @@ -195,8 +195,8 @@ class PCPath // we build the remaining xpath that follows the root element. while (itr.hasNext()) { action = (Action) itr.next(); - if (((XMLMapping) action.data).getXmlname() != null) - xpath.append(((XMLMapping) action.data).getXmlname()); + if (((XMLMetaData) action.data).getXmlname() != null) + xpath.append(((XMLMetaData) action.data).getXmlname()); else xpath.append("*"); if (itr.hasNext()) @@ -311,7 +311,7 @@ class PCPath _key = false; } - public void get(FieldMetaData fmd, XMLMapping meta) { + public void get(FieldMetaData fmd, XMLMetaData meta) { if (_actions == null) _actions = new LinkedList(); Action action = new Action(); @@ -324,7 +324,7 @@ class PCPath _xmlfield = fmd; } - public void get(XMLMapping meta, String name) { + public void get(XMLMetaData meta, String name) { Action action = new Action(); action.op = Action.GET_XPATH; action.data = meta.getFieldMapping(name); @@ -334,10 +334,10 @@ class PCPath _type = XPATH; } - public XMLMapping getXmlMapping() { + public XMLMetaData getXmlMapping() { Action act = (Action) _actions.getLast(); if (act != null) - return (XMLMapping) act.data; + return (XMLMetaData) act.data; return null; } @@ -384,7 +384,7 @@ class PCPath return _cast; Action act = lastFieldAction(); if (act != null && act.op == Action.GET_XPATH) - return ((XMLMapping) act.data).getType(); + return ((XMLMetaData) act.data).getType(); FieldMetaData fld = (act == null) ? null : (FieldMetaData) act.data; boolean key = act != null && act.op == Action.GET_KEY; diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java index bde553c96..e7b2c5186 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java @@ -28,7 +28,7 @@ import org.apache.openjpa.jdbc.sql.DBDictionary; import org.apache.openjpa.jdbc.sql.SQLBuffer; import org.apache.openjpa.jdbc.sql.Select; import org.apache.openjpa.kernel.exps.ExpressionVisitor; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; import serp.util.Numbers; /** @@ -190,7 +190,7 @@ class StartsWithExpression return null; } - public XMLMapping getXmlMapping() { + public XMLMetaData getXmlMapping() { return null; } @@ -275,7 +275,7 @@ class StartsWithExpression return null; } - public XMLMapping getXmlMapping() { + public XMLMetaData getXmlMapping() { return null; } } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java index 023ee0247..4e0571350 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java @@ -31,7 +31,7 @@ import org.apache.openjpa.lib.util.Localizer.Message; import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.meta.JavaTypes; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; import org.apache.openjpa.util.InternalException; import org.apache.openjpa.util.OpenJPAException; import org.apache.openjpa.util.UnsupportedException; @@ -247,7 +247,7 @@ public abstract class AbstractExpressionBuilder { } protected Value traverseXPath(Path path, String field) { - XMLMapping meta = path.getXmlMapping(); + XMLMetaData meta = path.getXmlMapping(); if (meta.getFieldMapping(field) == null) { throw parseException(EX_USER, "no-field", new Object[]{ meta.getType(), field }, null); @@ -297,7 +297,7 @@ public abstract class AbstractExpressionBuilder { } else { // xmlsupport xpath - XMLMapping xmlmeta = fmd.getRepository().getXMLMetaData(fmd); + XMLMetaData xmlmeta = fmd.getRepository().getXMLMetaData(fmd); if (xmlmeta != null) { path.get(fmd, xmlmeta); return path; diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java index 0f7226b33..27f06466c 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java @@ -30,7 +30,7 @@ import org.apache.openjpa.kernel.OpenJPAStateManager; import org.apache.openjpa.kernel.StoreContext; import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.FieldMetaData; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; /** * A path represents a traversal into fields of a candidate object. @@ -186,13 +186,13 @@ class CandidatePath } } - public void get(FieldMetaData fmd, XMLMapping meta) { + public void get(FieldMetaData fmd, XMLMetaData meta) { } - public void get(XMLMapping meta, String name) { + public void get(XMLMetaData meta, String name) { } - public XMLMapping getXmlMapping() { + public XMLMetaData getXmlMapping() { return null; } } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Path.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Path.java index 750f66393..71b41a2c6 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Path.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Path.java @@ -19,7 +19,7 @@ package org.apache.openjpa.kernel.exps; import org.apache.openjpa.meta.FieldMetaData; -import org.apache.openjpa.meta.XMLMapping; +import org.apache.openjpa.meta.XMLMetaData; /** * A path represents a traversal into fields of a candidate object. @@ -51,7 +51,7 @@ public interface Path * @param fmd field maps to xml column * @param meta associated xml mapping */ - public void get(FieldMetaData fmd, XMLMapping meta); + public void get(FieldMetaData fmd, XMLMetaData meta); /** * Traverse into the gevin xpath name of the current object, and update @@ -60,11 +60,11 @@ public interface Path * @param meta * @param name */ - public void get(XMLMapping meta, String name); + public void get(XMLMetaData meta, String name); /** * Return the current XPath's xmlmapping metadata. * @return Return xmlmapping */ - public XMLMapping getXmlMapping(); + public XMLMetaData getXmlMapping(); } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java index 5c96ce0b6..a31e68a08 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java @@ -1856,7 +1856,7 @@ public class MetaDataRepository * @param fmd * @return null */ - public XMLMapping getXMLMetaData(FieldMetaData fmd) { + public XMLMetaData getXMLMetaData(FieldMetaData fmd) { return null; } } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java index 31ee865b4..054ef3bf9 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java @@ -26,7 +26,7 @@ import org.apache.commons.lang.StringUtils; * @author Catalina Wei * @since 1.0.0 */ -public class XMLFieldMetaData implements XMLMapping { +public class XMLFieldMetaData implements XMLMetaData { private String _name; private String _xmlname = null; @@ -105,7 +105,7 @@ public class XMLFieldMetaData implements XMLMapping { return _xmltype == ATTRIBUTE; } - public XMLMapping getFieldMapping(String name) { + public XMLMetaData getFieldMapping(String name) { return null; } } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMapping.java b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java similarity index 96% rename from openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMapping.java rename to openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java index 7f2c744c6..af4128a0b 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMapping.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java @@ -26,7 +26,7 @@ import java.io.Serializable; * @author Catalina Wei * @since 1.0.0 */ -public interface XMLMapping extends Serializable { +public interface XMLMetaData extends Serializable { /** * JAXB XML binding default name */ @@ -55,7 +55,7 @@ public interface XMLMapping extends Serializable { * @param name the field name. * @return XMLMapping. */ - public XMLMapping getFieldMapping(String name); + public XMLMetaData getFieldMapping(String name); /** * Set type.