This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag maven-jcrocm-plugin-2.0.2-incubator in repository https://gitbox.apache.org/repos/asf/sling-maven-jcrocm-plugin.git
commit 32d408343f33346eddde02114fe692dd210abbad Author: Felix Meschberger <[email protected]> AuthorDate: Thu Sep 13 12:55:00 2007 +0000 Adapt to descriptor chances in latest Jackrabbit OCM Mapper snapshot git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/maven-jcrocm-plugin@575299 13f79535-47bb-0310-9956-ffa450edef68 --- .../sling/maven/jcrocm/AbstractNodeDescriptor.java | 8 +++--- .../apache/sling/maven/jcrocm/BeanDescriptor.java | 2 +- .../apache/sling/maven/jcrocm/ClassDescriptor.java | 10 +++---- .../sling/maven/jcrocm/CollectionDescriptor.java | 2 +- .../apache/sling/maven/jcrocm/FieldDescriptor.java | 32 ++-------------------- 5 files changed, 14 insertions(+), 40 deletions(-) diff --git a/src/main/java/org/apache/sling/maven/jcrocm/AbstractNodeDescriptor.java b/src/main/java/org/apache/sling/maven/jcrocm/AbstractNodeDescriptor.java index 9bc6f51..6e4dab1 100644 --- a/src/main/java/org/apache/sling/maven/jcrocm/AbstractNodeDescriptor.java +++ b/src/main/java/org/apache/sling/maven/jcrocm/AbstractNodeDescriptor.java @@ -34,7 +34,7 @@ public class AbstractNodeDescriptor extends AbstractItemDescriptor { public static final String AUTO_INSERT = "autoInsert"; - public static final String JCR_NODE_TYPE = "jcrNodeType"; + public static final String JCR_TYPE = "jcrType"; public static final String JCR_SAME_NAME_SIBBLINGS = "jcrSameNameSiblings"; @@ -46,7 +46,7 @@ public class AbstractNodeDescriptor extends AbstractItemDescriptor { private boolean isAutoInsert = true; - private String jcrNodeType; + private String jcrType; private boolean isJcrSameNameSibblings; @@ -57,7 +57,7 @@ public class AbstractNodeDescriptor extends AbstractItemDescriptor { public AbstractNodeDescriptor(Log log, DocletTag tag, String fieldName) { super(log, tag, fieldName); - jcrNodeType = tag.getNamedParameter(JCR_NODE_TYPE); + jcrType = tag.getNamedParameter(JCR_TYPE); isJcrSameNameSibblings = Boolean.valueOf( tag.getNamedParameter(JCR_SAME_NAME_SIBBLINGS)).booleanValue(); @@ -79,7 +79,7 @@ public class AbstractNodeDescriptor extends AbstractItemDescriptor { void generate(XMLWriter xmlWriter) { super.generate(xmlWriter); - xmlWriter.printAttribute(JCR_NODE_TYPE, jcrNodeType); + xmlWriter.printAttribute(JCR_TYPE, jcrType); xmlWriter.printAttribute(JCR_SAME_NAME_SIBBLINGS, isJcrSameNameSibblings); diff --git a/src/main/java/org/apache/sling/maven/jcrocm/BeanDescriptor.java b/src/main/java/org/apache/sling/maven/jcrocm/BeanDescriptor.java index 89fac88..53d79f6 100644 --- a/src/main/java/org/apache/sling/maven/jcrocm/BeanDescriptor.java +++ b/src/main/java/org/apache/sling/maven/jcrocm/BeanDescriptor.java @@ -36,7 +36,7 @@ import com.thoughtworks.qdox.model.JavaMethod; * autoUpdate (true|false) "true" * autoInsert (true|false) "true" * converter CDATA #IMPLIED - * jcrNodeType CDATA #IMPLIED + * jcrType CDATA #IMPLIED * jcrAutoCreated (true | false) "false" * jcrMandatory (true | false) "false" * jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY" diff --git a/src/main/java/org/apache/sling/maven/jcrocm/ClassDescriptor.java b/src/main/java/org/apache/sling/maven/jcrocm/ClassDescriptor.java index a332e3e..191a9f2 100644 --- a/src/main/java/org/apache/sling/maven/jcrocm/ClassDescriptor.java +++ b/src/main/java/org/apache/sling/maven/jcrocm/ClassDescriptor.java @@ -36,7 +36,7 @@ import com.thoughtworks.qdox.model.JavaClass; * <pre> * <!ATTLIST class-descriptor * className CDATA #REQUIRED - * jcrNodeType CDATA #IMPLIED + * jcrType CDATA #IMPLIED * jcrSuperTypes CDATA #IMPLIED * jcrMixinTypes CDATA #IMPLIED * extend CDATA #IMPLIED @@ -63,7 +63,7 @@ public class ClassDescriptor extends AbstractDescriptorElement { public static final String CLASS_NAME = "className"; - public static final String JCR_NODE_TYPE = "jcrNodeType"; + public static final String JCR_TYPE = "jcrType"; public static final String JCR_SUPER_TYPES = "jcrSuperTypes"; @@ -85,7 +85,7 @@ public class ClassDescriptor extends AbstractDescriptorElement { private String className; - private String jcrNodeType; + private String jcrType; private String jcrSuperTypes; @@ -155,7 +155,7 @@ public class ClassDescriptor extends AbstractDescriptorElement { } } - cd.jcrNodeType = tag.getNamedParameter(JCR_NODE_TYPE); + cd.jcrType = tag.getNamedParameter(JCR_TYPE); cd.jcrSuperTypes = tag.getNamedParameter(JCR_SUPER_TYPES); cd.jcrMixinTypes = tag.getNamedParameter(JCR_MIXIN_TYPES); @@ -194,7 +194,7 @@ public class ClassDescriptor extends AbstractDescriptorElement { xmlWriter.printElementStart(ELEMENT_CLASS_DESCRIPTOR, true); xmlWriter.printAttribute(CLASS_NAME, className); - xmlWriter.printAttribute(JCR_NODE_TYPE, jcrNodeType); + xmlWriter.printAttribute(JCR_TYPE, jcrType); xmlWriter.printAttribute(JCR_SUPER_TYPES, jcrSuperTypes); xmlWriter.printAttribute(JCR_MIXIN_TYPES, jcrMixinTypes); xmlWriter.printAttribute(EXTEND, extend); diff --git a/src/main/java/org/apache/sling/maven/jcrocm/CollectionDescriptor.java b/src/main/java/org/apache/sling/maven/jcrocm/CollectionDescriptor.java index c32a93c..c5cfdfc 100644 --- a/src/main/java/org/apache/sling/maven/jcrocm/CollectionDescriptor.java +++ b/src/main/java/org/apache/sling/maven/jcrocm/CollectionDescriptor.java @@ -38,7 +38,7 @@ import com.thoughtworks.qdox.model.JavaMethod; * elementClassName CDATA #IMPLIED * collectionClassName CDATA #IMPLIED * collectionConverter CDATA #IMPLIED - * jcrNodeType CDATA #IMPLIED + * jcrType CDATA #IMPLIED * jcrAutoCreated (true | false) "false" * jcrMandatory (true | false) "false" * jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY" diff --git a/src/main/java/org/apache/sling/maven/jcrocm/FieldDescriptor.java b/src/main/java/org/apache/sling/maven/jcrocm/FieldDescriptor.java index c96b192..38d1745 100644 --- a/src/main/java/org/apache/sling/maven/jcrocm/FieldDescriptor.java +++ b/src/main/java/org/apache/sling/maven/jcrocm/FieldDescriptor.java @@ -53,8 +53,6 @@ public class FieldDescriptor extends AbstractItemDescriptor { public static final String ELEMENT_FIELD_DESCRIPTOR = "field-descriptor"; - public static final String FIELD_TYPE = "fieldType"; - public static final String ID = "id"; public static final String PATH = "path"; @@ -71,8 +69,6 @@ public class FieldDescriptor extends AbstractItemDescriptor { public static final String JCR_MULTIPLE = "jcrMultiple"; - private String fieldType; - private boolean isId; private boolean isPath; @@ -96,14 +92,7 @@ public class FieldDescriptor extends AbstractItemDescriptor { return null; } - // field type is explicitly declared or Java field type - String fieldType = tag.getNamedParameter(FIELD_TYPE); - if (fieldType == null) { - fieldType = field.getType().getJavaClass().getFullyQualifiedName(); - } - - return new FieldDescriptor(log, tag, field.getName(), - fieldType); + return new FieldDescriptor(log, tag, field.getName()); } static FieldDescriptor fromMethod(Log log, JavaMethod method) { @@ -120,26 +109,12 @@ public class FieldDescriptor extends AbstractItemDescriptor { fieldName = getFieldFromMethod(method); } - // field type is explicitly declared or parameter or return value - String fieldType = tag.getNamedParameter(FIELD_TYPE); - if (fieldType == null) { - if (method.getParameters() != null - && method.getParameters().length == 1) { - fieldType = method.getParameters()[0].getType().getJavaClass().getFullyQualifiedName(); - } else if (method.getReturns() != null) { - fieldType = method.getReturns().getJavaClass().getFullyQualifiedName(); - } - } - - return new FieldDescriptor(log, tag, fieldName, fieldType); + return new FieldDescriptor(log, tag, fieldName); } - private FieldDescriptor(Log log, DocletTag tag, String fieldName, - String fieldType) { + private FieldDescriptor(Log log, DocletTag tag, String fieldName) { super(log, tag, fieldName); - this.fieldType = fieldType; - isId = Boolean.valueOf(tag.getNamedParameter(ID)).booleanValue(); isPath = Boolean.valueOf(tag.getNamedParameter(PATH)).booleanValue(); isUuid = Boolean.valueOf(tag.getNamedParameter(UUID)).booleanValue(); @@ -161,7 +136,6 @@ public class FieldDescriptor extends AbstractItemDescriptor { super.generate(xmlWriter); - xmlWriter.printAttribute(FIELD_TYPE, fieldType); xmlWriter.printAttribute(ID, isId); xmlWriter.printAttribute(PATH, isPath); xmlWriter.printAttribute(UUID, isUuid); -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
