OPENJPA-240 XMLMapping Query - rename XMLMetaData to XMLFieldMetaData

Help Catalina committing changes for renaming classes, part 1.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@559172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David J. Wisneski 2007-07-24 19:40:09 +00:00
parent 126ed03a3b
commit 9316b8157d
2 changed files with 14 additions and 8 deletions

View File

@ -33,7 +33,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;
/**
@ -178,8 +178,14 @@ public class XMLClassMetaData implements XMLMapping
private synchronized void populateFromReflection(Class cls,
XMLMappingRepository repos) {
Member[] members;
if (((XmlAccessorType)cls.getAnnotation(XmlAccessorType.class)).value()
Member[] members;
Class superclass = cls.getSuperclass();
// handle inheritance at sub-element level
if (superclass.isAnnotationPresent(XmlType.class))
populateFromReflection(superclass, repos);
if (((XmlAccessorType) cls.getAnnotation(XmlAccessorType.class)).value()
== XmlAccessType.FIELD)
members = cls.getDeclaredFields();
else
@ -201,7 +207,7 @@ public class XMLClassMetaData implements XMLMapping
field.setXmlname(xmlname);
}
else {
field = new XMLMetaData();
field = new XMLFieldMetaData();
field.setXmltype(ELEMENT);
field.setXmlname(xmlname);
field.setXmlnamespace(el.getAnnotation(XmlElement.class)
@ -209,8 +215,8 @@ public class XMLClassMetaData implements XMLMapping
}
}
else if (el.getAnnotation(XmlAttribute.class) != null) {
field = new XMLMetaData();
field.setXmltype(XMLMetaData.ATTRIBUTE);
field = new XMLFieldMetaData();
field.setXmltype(XMLFieldMetaData.ATTRIBUTE);
String xmlname = el.getAnnotation(XmlAttribute.class).name();
// avoid JAXB XML bind default name
if (StringUtils.equals(defaultName, xmlname))

View File

@ -26,7 +26,7 @@ import org.apache.commons.lang.StringUtils;
* @author Catalina Wei
* @since 1.0.0
*/
public class XMLMetaData implements XMLMapping {
public class XMLFieldMetaData implements XMLMapping {
private String _name;
private String _xmlname = null;
@ -37,7 +37,7 @@ public class XMLMetaData implements XMLMapping {
private int _code = JavaTypes.OBJECT;
private int _xmltype;
public XMLMetaData() {
public XMLFieldMetaData() {
}
public Class getType() {