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
This commit is contained in:
David J. Wisneski 2007-07-24 19:51:19 +00:00
parent 9316b8157d
commit c70b70b30f
14 changed files with 49 additions and 49 deletions

View File

@ -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];
}
}

View File

@ -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

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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();
}

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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();
}

View File

@ -1856,7 +1856,7 @@ public class MetaDataRepository
* @param fmd
* @return null
*/
public XMLMapping getXMLMetaData(FieldMetaData fmd) {
public XMLMetaData getXMLMetaData(FieldMetaData fmd) {
return null;
}
}

View File

@ -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;
}
}

View File

@ -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.