directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r564040 - in /directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l: annotations/ annotations/attribute/ annotations/common/ annotations/objectClass/ descriptions/
Date Wed, 08 Aug 2007 22:59:07 GMT
Author: akarasulu
Date: Wed Aug  8 15:59:04 2007
New Revision: 564040

URL: http://svn.apache.org/viewvc?view=rev&rev=564040
Log:
changes from last week which I forgot to commit

Added:
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMay.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMust.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapAliases.java   (contents, props changed)
      - copied, changed from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeAliases.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapDescription.java   (contents, props changed)
      - copied, changed from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeDescription.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtension.java   (contents, props changed)
      - copied, changed from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtension.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtensions.java   (contents, props changed)
      - copied, changed from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtensions.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapObsolete.java   (contents, props changed)
      - copied, changed from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeObsolete.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapOid.java   (contents, props changed)
      - copied, changed from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeOid.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/package.html
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectClassType.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectSuperTypes.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassToBeanMapping.java
Removed:
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapAttributeToPropertyMapping.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassAliases.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassRdnAttributes.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeAliases.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeDescription.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeObsolete.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeOid.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtension.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtensions.java
Modified:
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassDescriptionExtractor.java

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMay.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMay.java?view=auto&rev=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMay.java (added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMay.java Wed Aug  8 15:59:04 2007
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.j2l.annotations.attribute;
+
+import java.lang.annotation.*;
+
+/**
+ * A marker annotation used to mark a bean property and it's respective
+ * generated attributeType as optional in the RDN of the entry.  This
+ * marker can only be used on the methods of beans which generate
+ * <code>STRUCTURAL</code> objectClasses: note that in general non-abstract classes
+ * produce <code>STRUCTURAL</code> objectClasses.  If this marker is used for a
+ * non-structural objectClass then an error will result.
+ *
+ * This cues the engine to add a nameForm for the objectClass which
+ * contains the attributeType associated with the property within the
+ * <code>MAY</code> list of the nameForm.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+@Documented
+@Inherited
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.METHOD )
+public @interface LdapAttributeRdnMay
+{
+}

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMust.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMust.java?view=auto&rev=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMust.java (added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeRdnMust.java Wed Aug  8 15:59:04 2007
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.j2l.annotations.attribute;
+
+
+import java.lang.annotation.*;
+
+
+/**
+ * A marker annotation used to mark a bean property and it's respective
+ * generated attributeType as required in the RDN of the entry.  This
+ * marker can only be used on the methods of beans which generate
+ * <code>STRUCTURAL</code> objectClasses: note that in general non-abstract classes
+ * produce <code>STRUCTURAL</code> objectClasses.  If this marker is used for
+ * non-structural objectClasses an error will result.
+ *
+ * This cues the engine to add a nameForm for the objectClass which
+ * contains the attributeType associated with the property within the
+ * <code>MUST</code> list of the nameForm.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+@Documented
+@Inherited
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.METHOD )
+public @interface LdapAttributeRdnMust
+{
+}

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapAliases.java (from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeAliases.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapAliases.java?view=diff&rev=564040&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeAliases.java&r1=560055&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapAliases.java&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeAliases.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapAliases.java Wed Aug  8 15:59:04 2007
@@ -17,21 +17,24 @@
  *  under the License.
  *
  */
-package org.apache.directory.j2l.annotations.attribute;
+package org.apache.directory.j2l.annotations.common;
+
 
 import java.lang.annotation.*;
 
+
 /**
  * Overrides the default mechanism for assigning aliases to generated
- * attributeType definition.
+ * schema entity descriptions like attributeTypes and objectClasses.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
+@Documented
 @Inherited
-@Retention(RetentionPolicy.RUNTIME)
-@Target( ElementType.METHOD )
-public @interface LdapAttributeAliases
+@Retention( RetentionPolicy.RUNTIME )
+@Target( { ElementType.TYPE, ElementType.METHOD } )
+public @interface LdapAliases
 {
     String[] value();
 }

Propchange: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapAliases.java
------------------------------------------------------------------------------
    svn:executable = *

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapDescription.java (from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeDescription.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapDescription.java?view=diff&rev=564040&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeDescription.java&r1=560055&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapDescription.java&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeDescription.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapDescription.java Wed Aug  8 15:59:04 2007
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations.attribute;
+package org.apache.directory.j2l.annotations.common;
 
 import java.lang.annotation.*;
 
@@ -28,10 +28,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
+@Documented
 @Inherited
 @Retention ( RetentionPolicy.RUNTIME )
-@Target ( ElementType.METHOD )
-public @interface LdapAttributeDescription
+@Target ( { ElementType.METHOD, ElementType.TYPE } )
+public @interface LdapDescription
 {
     String value();
 }

Propchange: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapDescription.java
------------------------------------------------------------------------------
    svn:executable = *

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtension.java (from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtension.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtension.java?view=diff&rev=564040&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtension.java&r1=560055&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtension.java&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtension.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtension.java Wed Aug  8 15:59:04 2007
@@ -17,20 +17,23 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations.attribute;
+package org.apache.directory.j2l.annotations.common;
+
 
 import java.lang.annotation.*;
 
+
 /**
- * Used to specify a schema extension and values for an attributeType.
+ * Used to specify a schema extension and it's values for various kinds
+ * of schema entities.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 @Inherited
 @Retention( RetentionPolicy.RUNTIME)
-@Target( ElementType.METHOD )
-public @interface LdapAttributeSchemaExtension
+@Target( { ElementType.METHOD, ElementType.TYPE } )
+public @interface LdapExtension
 {
     String name();
     String[] values();

Propchange: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtension.java
------------------------------------------------------------------------------
    svn:executable = *

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtensions.java (from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtensions.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtensions.java?view=diff&rev=564040&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtensions.java&r1=560055&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtensions.java&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSchemaExtensions.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtensions.java Wed Aug  8 15:59:04 2007
@@ -17,13 +17,14 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations.attribute;
+package org.apache.directory.j2l.annotations.common;
 
 import java.lang.annotation.*;
 
 /**
- * Used to override schema extensions for an attributeType.  An array of
- * LdapAttributeSchemaExtension objects must be given as the value.
+ * Used to override schema extensions for various kinds of schema
+ * entities.  An array of LdapExtension objects must be given as the
+ * value.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -31,8 +32,8 @@
 @Documented
 @Inherited
 @Retention( RetentionPolicy.RUNTIME)
-@Target( ElementType.METHOD )
-public @interface LdapAttributeSchemaExtensions
+@Target( { ElementType.METHOD, ElementType.TYPE } )
+public @interface LdapExtensions
 {
-    LdapAttributeSchemaExtension[] value();
+    LdapExtension[] value();
 }

Propchange: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapExtensions.java
------------------------------------------------------------------------------
    svn:executable = *

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapObsolete.java (from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeObsolete.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapObsolete.java?view=diff&rev=564040&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeObsolete.java&r1=560055&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapObsolete.java&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeObsolete.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapObsolete.java Wed Aug  8 15:59:04 2007
@@ -17,19 +17,20 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations.attribute;
+package org.apache.directory.j2l.annotations.common;
 
 import java.lang.annotation.*;
 
 /**
- * Overrides default by setting an attributeType as collective.
+ * Overrides default by setting a schema entity as obsolete.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
+@Documented
 @Inherited
 @Retention( RetentionPolicy.RUNTIME )
-@Target( ElementType.METHOD )
-public @interface LdapAttributeObsolete
+@Target( { ElementType.METHOD, ElementType.TYPE } )
+public @interface LdapObsolete
 {
 }

Propchange: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapObsolete.java
------------------------------------------------------------------------------
    svn:executable = *

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapOid.java (from r560055, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeOid.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapOid.java?view=diff&rev=564040&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeOid.java&r1=560055&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapOid.java&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeOid.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapOid.java Wed Aug  8 15:59:04 2007
@@ -17,15 +17,16 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations.attribute;
+package org.apache.directory.j2l.annotations.common;
 
 import java.lang.annotation.*;
 
 /**
  * Overrides the default OID assignment mechanism to set the numeric
- * OID of the new attributeType explicitly.  By default the J2L system
- * automatically and sequencially generates OIDs for new attributeTypes
- * using a base OID along with a schema specific branch off that OID base.
+ * OID of the new schema entity explicitly.  By default the persistence
+ * engine automatically and sequencially generates OIDs for new schema
+ * entities a base OID along with a schema specific branch off that OID
+ * base.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -33,8 +34,8 @@
 @Documented
 @Inherited
 @Retention( RetentionPolicy.RUNTIME )
-@Target( ElementType.METHOD )
-public @interface LdapAttributeOid
+@Target( { ElementType.METHOD, ElementType.TYPE } )
+public @interface LdapOid
 {
     String value();
 }

Propchange: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/LdapOid.java
------------------------------------------------------------------------------
    svn:executable = *

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/package.html
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/package.html?view=auto&rev=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/package.html (added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/common/package.html Wed Aug  8 15:59:04 2007
@@ -0,0 +1,9 @@
+<h2>LDAP Schema Annotations Common to All Schema Entities</h2>
+
+<ul>
+    <li>LdapAliases</li>
+    <li>LdapDescription</li>
+    <li>LdapExtensions</li>
+    <li>LdapObsolete</li>
+    <li>LdapOid</li>
+</ul>
\ No newline at end of file

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectClassType.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectClassType.java?view=auto&rev=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectClassType.java (added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectClassType.java Wed Aug  8 15:59:04 2007
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.j2l.annotations.objectClass;
+
+
+import org.apache.directory.shared.ldap.schema.UsageEnum;
+import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+
+import java.lang.annotation.*;
+
+
+/**
+ * Overrides the default mechanism used to determine the objectClass type
+ * for a bean.  By default this is inferred from the bean which generates
+ * the objectClass.  If the bean is not concrete then an objectClass of type
+ * <code>ABSTRACT</code> will be produced, if the bean is an interface then
+ * an objectClass of type <code>AUXILIARY</code> will be produced.  If the
+ * bean is a class and it is not abstract then an objectClass of type
+ * <code>STRUCTURAL</code> will be produced.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+@Documented
+@Inherited
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.TYPE )
+public @interface LdapObjectClassType
+{
+    ObjectClassTypeEnum value();
+}

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectSuperTypes.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectSuperTypes.java?view=auto&rev=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectSuperTypes.java (added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/LdapObjectSuperTypes.java Wed Aug  8 15:59:04 2007
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.j2l.annotations.objectClass;
+
+
+import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+
+import java.lang.annotation.*;
+
+
+/**
+ * Overrides the default mechanism used to determine the objectClass super
+ * types for a bean.  By default this is inferred from the bean which generates
+ * the objectClass.  If the bean is not concrete then an objectClass of type
+ * <code>ABSTRACT</code> will be produced, if the bean is an interface then
+ * an objectClass of type <code>AUXILIARY</code> will be produced.  If the
+ * bean is a class and it is not abstract then an objectClass of type
+ * <code>STRUCTURAL</code> will be produced.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+@Documented
+@Inherited
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.TYPE )
+public @interface LdapObjectSuperTypes
+{
+    String[] value();
+}

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java?view=diff&rev=564040&r1=564039&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java Wed Aug  8 15:59:04 2007
@@ -22,6 +22,7 @@
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.j2l.configuration.J2LConfiguration;
 import org.apache.directory.j2l.annotations.attribute.*;
+import org.apache.directory.j2l.annotations.common.*;
 import org.apache.commons.beanutils.DynaClass;
 import org.apache.commons.beanutils.DynaProperty;
 import org.apache.commons.beanutils.WrapDynaClass;
@@ -215,41 +216,88 @@
     {
         Map<Class, Annotation> annotations = mapping.getAllPropertyAnnotations();
 
-        // ----- IgnoreBeanProperty --------------------------------------------------
-
-        if ( annotations.containsKey( IgnoreBeanProperty.class ) )
-        {
-            log.info( "Ignoring {} property.", mapping.getDynaProperty().getName() );
-            mapping.setIgnored( true );
-            return;
-        }
+        // -------------------------------------------------------------------
+        // Look for common schema description annotations first
+        // -------------------------------------------------------------------
 
-        // ----- LdapAttributeAliases --------------------------------------------------
+        // ----- LdapAliases --------------------------------------------------
 
-        if ( annotations.containsKey( LdapAttributeAliases.class ) )
+        if ( annotations.containsKey( LdapAliases.class ) )
         {
-            String[] aliases = ( ( LdapAttributeAliases ) annotations.get( LdapAttributeAliases.class ) ).value();
+            String[] aliases = ( ( LdapAliases ) annotations.get( LdapAliases.class ) ).value();
             List<String> names = new ArrayList<String>(aliases.length);
             CollectionUtils.addAll( names, aliases );
             log.info( "Overriding aliases {} for {} property.", names, mapping.getDynaProperty().getName() );
             mapping.getAttributeTypeDescription().setNames( names );
         }
 
-        // ----- LdapAttributeCollective --------------------------------------------------
+        // ----- LdapDescription --------------------------------------------------
 
-        if ( annotations.containsKey( LdapAttributeCollective.class ) )
+        if ( annotations.containsKey( LdapDescription.class ) )
         {
-            log.info( "Setting {} property as collective attributeType.", mapping.getDynaProperty().getName() );
-            mapping.getAttributeTypeDescription().setCollective( true );
+            String desc = ( ( LdapDescription ) annotations.get( LdapDescription.class ) ).value();
+            log.info( "Setting {} property's attributeType description.", mapping.getDynaProperty().getName() );
+            mapping.getAttributeTypeDescription().setDescription( desc );
         }
 
-        // ----- LdapAttributeDescription --------------------------------------------------
+        // ----- LdapObsolete --------------------------------------------------
 
-        if ( annotations.containsKey( LdapAttributeDescription.class ) )
+        if ( annotations.containsKey( LdapObsolete.class ) )
         {
-            String desc = ( ( LdapAttributeDescription ) annotations.get( LdapAttributeDescription.class ) ).value();
-            log.info( "Setting {} property's attributeType description.", mapping.getDynaProperty().getName() );
-            mapping.getAttributeTypeDescription().setDescription( desc );
+            log.info( "Marking {} property's attributeType will be obsolete.", mapping.getDynaProperty().getName() );
+            mapping.getAttributeTypeDescription().setObsolete( true );
+        }
+
+        // ----- LdapOid --------------------------------------------------
+
+        if ( annotations.containsKey( LdapOid.class ) )
+        {
+            String oid = ( ( LdapOid ) annotations.get( LdapOid.class ) ).value();
+            log.info( "Overriding sequentially assigned OID for {} property: using {} instead.",
+                    mapping.getDynaProperty().getName(), oid );
+            mapping.getAttributeTypeDescription().setNumericOid( oid );
+        }
+
+        // ----- LdapExtension[s] --------------------------------------------------
+
+        if ( annotations.containsKey( LdapExtensions.class ) )
+        {
+            LdapExtension[] extentionsArrays = ( ( LdapExtensions )
+                    annotations.get( LdapExtensions.class ) ).value();
+            Map<String, List<String>> extensions = new HashMap<String, List<String>>( extentionsArrays.length );
+            for ( LdapExtension extension : extentionsArrays )
+            {
+                String[] valuesArray = extension.values();
+                List<String> values = new ArrayList<String>( valuesArray.length );
+                CollectionUtils.addAll( values, valuesArray );
+                extensions.put( extension.name(), values );
+            }
+
+            log.info( "Adding schema extensions for attributeType description of {} property: {}",
+                    mapping.getDynaProperty().getName(), extensions );
+            mapping.getAttributeTypeDescription().setExtensions( extensions );
+        }
+
+
+        // -------------------------------------------------------------------
+        // Look for attributeType schema description annotations
+        // -------------------------------------------------------------------
+
+        // ----- IgnoreBeanProperty --------------------------------------------------
+
+        if ( annotations.containsKey( IgnoreBeanProperty.class ) )
+        {
+            log.info( "Ignoring {} property.", mapping.getDynaProperty().getName() );
+            mapping.setIgnored( true );
+            return;
+        }
+
+        // ----- LdapAttributeCollective --------------------------------------------------
+
+        if ( annotations.containsKey( LdapAttributeCollective.class ) )
+        {
+            log.info( "Setting {} property as collective attributeType.", mapping.getDynaProperty().getName() );
+            mapping.getAttributeTypeDescription().setCollective( true );
         }
 
         // ----- LdapAttributeEqualityMatch --------------------------------------------------
@@ -278,24 +326,6 @@
             mapping.getAttributeTypeDescription().setUserModifiable( false );
         }
 
-        // ----- LdapAttributeObsolete --------------------------------------------------
-
-        if ( annotations.containsKey( LdapAttributeObsolete.class ) )
-        {
-            log.info( "Marking {} property's attributeType will be obsolete.", mapping.getDynaProperty().getName() );
-            mapping.getAttributeTypeDescription().setObsolete( true );
-        }
-
-        // ----- LdapAttributeOid --------------------------------------------------
-
-        if ( annotations.containsKey( LdapAttributeOid.class ) )
-        {
-            String oid = ( ( LdapAttributeOid ) annotations.get( LdapAttributeOid.class ) ).value();
-            log.info( "Overriding sequentially assigned OID for {} property: using {} instead.", 
-                    mapping.getDynaProperty().getName(), oid );
-            mapping.getAttributeTypeDescription().setNumericOid( oid );
-        }
-
         // ----- LdapAttributeOrderingMatch --------------------------------------------------
 
         if ( annotations.containsKey( LdapAttributeOrderingMatch.class ) )
@@ -315,26 +345,6 @@
             mapping.setRequired( true );
         }
 
-        // ----- LdapAttributeSchemaExtension[s] --------------------------------------------------
-
-        if ( annotations.containsKey( LdapAttributeSchemaExtensions.class ) )
-        {
-            LdapAttributeSchemaExtension[] extentionsArray = ( ( LdapAttributeSchemaExtensions )
-                    annotations.get( LdapAttributeSchemaExtensions.class ) ).value();
-            Map<String, List<String>> extensions = new HashMap<String, List<String>>( extentionsArray.length );
-            for ( LdapAttributeSchemaExtension extension : extentionsArray )
-            {
-                String[] valuesArray = extension.values();
-                List<String> values = new ArrayList<String>( valuesArray.length );
-                CollectionUtils.addAll( values, valuesArray );
-                extensions.put( extension.name(), values );
-            }
-
-            log.info( "Adding schema extensions for attributeType description of {0} property: {1}",
-                    mapping.getDynaProperty().getName(), extensions );
-            mapping.getAttributeTypeDescription().setExtensions( extensions );
-        }
-
         // ----- LdapAttributeSubstringMatch --------------------------------------------------
 
         if ( annotations.containsKey( LdapAttributeSubstringMatch.class ) )
@@ -387,25 +397,14 @@
             throw new NotImplementedException( "Only simple properties are handled." );
         }
 
-        mapping.getAttributeTypeDescription().setUsage( UsageEnum.USER_APPLICATIONS );
+        // -------------------------------------------------------------------
+        // setup common schema description properties first
+        // -------------------------------------------------------------------
+
         mapping.getAttributeTypeDescription().setNumericOid(
                 configuration.getSchemaConfiguration().getOidGenerator().nextAttributeTypeOid() );
-        mapping.getAttributeTypeDescription().setCollective( false );
         mapping.getAttributeTypeDescription().setDescription( "undocumented" );
         mapping.getAttributeTypeDescription().setObsolete( false );
-        mapping.getAttributeTypeDescription().setSingleValued( true );
-        mapping.getAttributeTypeDescription().setUserModifiable( true );
-        mapping.getAttributeTypeDescription().setSuperType( null );
-
-        // hook up the matching rules using default mappings setup in the configuration
-        mapping.getAttributeTypeDescription().setEqualityMatchingRule(
-                mapping.getPrimitiveMapping().getEqualityMatchingRule() );
-        mapping.getAttributeTypeDescription().setOrderingMatchingRule(
-                mapping.getPrimitiveMapping().getOrderingMatchingRule() );
-        mapping.getAttributeTypeDescription().setSubstringsMatchingRule(
-                mapping.getPrimitiveMapping().getSubstringMatchingRule() );
-
-        mapping.getAttributeTypeDescription().setSyntax( mapping.getPrimitiveMapping().getLdapSyntaxOid() );
 
         // ----- setup extensions ----------------------------
         String schemaName = configuration.getSchemaConfiguration().getName();
@@ -427,6 +426,26 @@
                     StringUtils.capitalize( mapping.getDynaProperty().getName() );
         }
         mapping.getAttributeTypeDescription().setNames( Collections.singletonList( name ) );
+
+        // -------------------------------------------------------------------
+        // setup attributeType description specific properties
+        // -------------------------------------------------------------------
+
+        mapping.getAttributeTypeDescription().setUsage( UsageEnum.USER_APPLICATIONS );
+        mapping.getAttributeTypeDescription().setCollective( false );
+        mapping.getAttributeTypeDescription().setSingleValued( true );
+        mapping.getAttributeTypeDescription().setUserModifiable( true );
+        mapping.getAttributeTypeDescription().setSuperType( null );
+
+        // hook up the matching rules using default mappings setup in the configuration
+        mapping.getAttributeTypeDescription().setEqualityMatchingRule(
+                mapping.getPrimitiveMapping().getEqualityMatchingRule() );
+        mapping.getAttributeTypeDescription().setOrderingMatchingRule(
+                mapping.getPrimitiveMapping().getOrderingMatchingRule() );
+        mapping.getAttributeTypeDescription().setSubstringsMatchingRule(
+                mapping.getPrimitiveMapping().getSubstringMatchingRule() );
+
+        mapping.getAttributeTypeDescription().setSyntax( mapping.getPrimitiveMapping().getLdapSyntaxOid() );
     }
 
 

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassDescriptionExtractor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassDescriptionExtractor.java?view=diff&rev=564040&r1=564039&r2=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassDescriptionExtractor.java (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassDescriptionExtractor.java Wed Aug  8 15:59:04 2007
@@ -19,33 +19,204 @@
  */
 package org.apache.directory.j2l.descriptions;
 
+
 import org.apache.directory.j2l.configuration.J2LConfiguration;
+import org.apache.directory.j2l.annotations.common.*;
 import org.apache.directory.shared.ldap.schema.syntax.ObjectClassDescription;
+import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.commons.collections.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+import java.lang.reflect.Modifier;
+import java.lang.annotation.Annotation;
 
-import java.util.Set;
-import java.util.HashSet;
 
 /**
- * Document me!
+ * Extracts the objectClass description from a bean class.
+ *
+ * @TODO determine when multiple supertypes can be used and what is allowed to
+ * be a supertype when the different types of objectClasses (AUXILIARY, ABSTRACT,
+ * and STRUCTURAL) are considered.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 public class ObjectClassDescriptionExtractor
 {
+    private final static Logger log = LoggerFactory.getLogger( ObjectClassDescriptionExtractor.class );
+
     private final J2LConfiguration configuration;
+    private final AttributeTypeExtractor attributeTypeExtractor;
+    private final Map<Class, Annotation> annotations = new HashMap<Class, Annotation>();
 
 
     public ObjectClassDescriptionExtractor( J2LConfiguration configuration )
     {
         this.configuration = configuration;
+        this.attributeTypeExtractor = new AttributeTypeExtractor( configuration );
+    }
+
+
+    public ObjectClassToBeanMapping extractObjectClassDescription( Class beanClass )
+    {
+        ObjectClassToBeanMapping mapping = new ObjectClassToBeanMapping( beanClass,
+                attributeTypeExtractor.extractAttributeToPropertyMappings( beanClass ) );
+        populateWithOutAnnotations( mapping );
+
+        // add all class level annotations to the map and populate desc with annotations
+        for ( Annotation annotation : beanClass.getAnnotations() )
+        {
+            annotations.put( annotation.getClass(), annotation );
+        }
+        populateWithAnnotations( mapping );
+        return mapping;
+    }
+
+
+    private void populateWithAnnotations( ObjectClassToBeanMapping mapping )
+    {
+        // -------------------------------------------------------------------
+        // Look for common schema description annotations first
+        // -------------------------------------------------------------------
+
+        // ----- LdapAliases --------------------------------------------------
+
+        if ( annotations.containsKey( LdapAliases.class ) )
+        {
+            String[] aliases = ( ( LdapAliases ) annotations.get( LdapAliases.class ) ).value();
+            List<String> names = new ArrayList<String>(aliases.length);
+            CollectionUtils.addAll( names, aliases );
+            log.info( "Overriding aliases {} for beanClass.", names, mapping.getBeanClass().getName() );
+            mapping.getDescription().setNames( names );
+        }
+
+        // ----- LdapDescription --------------------------------------------------
+
+        if ( annotations.containsKey( LdapDescription.class ) )
+        {
+            String desc = ( ( LdapDescription ) annotations.get( LdapDescription.class ) ).value();
+            log.info( "Setting objectClass description for beanClass {}.", mapping.getBeanClass().getName() );
+            mapping.getDescription().setDescription( desc );
+        }
+
+        // ----- LdapObsolete --------------------------------------------------
+
+        if ( annotations.containsKey( LdapObsolete.class ) )
+        {
+            log.info( "Marking objectClass obsolete for beanClass {}.", mapping.getBeanClass().getName() );
+            mapping.getDescription().setObsolete( true );
+        }
+
+        // ----- LdapOid --------------------------------------------------
+
+        if ( annotations.containsKey( LdapOid.class ) )
+        {
+            String oid = ( ( LdapOid ) annotations.get( LdapOid.class ) ).value();
+            log.info( "Overriding sequentially assigned OID for beanClass {}: using {} instead.",
+                    mapping.getBeanClass().getName(), oid );
+            mapping.getDescription().setNumericOid( oid );
+        }
+
+        // ----- LdapExtension[s] --------------------------------------------------
+
+        if ( annotations.containsKey( LdapExtensions.class ) )
+        {
+            LdapExtension[] extentionsArrays = ( ( LdapExtensions )
+                    annotations.get( LdapExtensions.class ) ).value();
+            Map<String, List<String>> extensions = new HashMap<String, List<String>>( extentionsArrays.length );
+            for ( LdapExtension extension : extentionsArrays )
+            {
+                String[] valuesArray = extension.values();
+                List<String> values = new ArrayList<String>( valuesArray.length );
+                CollectionUtils.addAll( values, valuesArray );
+                extensions.put( extension.name(), values );
+            }
+
+            log.info( "Adding schema extensions for objectClass description of beanClass {}: \nextensions are {}",
+                    mapping.getBeanClass().getName(), extensions );
+            mapping.getDescription().setExtensions( extensions );
+
+            // -------------------------------------------------------------------
+            // Look for objectClass schema description annotations
+            // -------------------------------------------------------------------
+
+            // ----- ???????? --------------------------------------------------
+
+
+            throw new NotImplementedException( "need to complete this method" );
+        }
+
+    }
+
+
+    private void populateWithOutAnnotations( ObjectClassToBeanMapping mapping )
+    {
+        // populate the MAY and MUST lists
+        for ( AttributeToPropertyMapping at2property : mapping.getPropertyMappings() )
+        {
+            if ( at2property.isIgnored() )
+            {
+                continue;
+            }
+
+            String name = at2property.getAttributeTypeDescription().getNames().get( 0 );
+            if ( at2property.isRequired() )
+            {
+                mapping.getDescription().addMustAttributeType( name );
+            }
+            else
+            {
+                mapping.getDescription().addMayAttributeType( name );
+            }
+        }
+
+        mapping.getDescription().setKind( getObjectClassType( mapping.getBeanClass() ) );
+        mapping.getDescription().setDescription( "undocumented" );
+        mapping.getDescription().setObsolete( false );
+        mapping.getDescription().setNumericOid(
+                configuration.getSchemaConfiguration().getOidGenerator().nextObjectClassOid() );
+
+        // ----- setup extensions ----------------------------
+        String schemaName = configuration.getSchemaConfiguration().getName();
+        Map<String, List<String>> extensions = new HashMap<String, List<String>>();
+        extensions.put( "X-SCHEMA", Collections.singletonList( schemaName ) );
+        mapping.getDescription().setExtensions( extensions );
+
+        // ----- setup the name ------------------------------
+        String name;
+        if ( configuration.getEntityPrefix() != null )
+        {
+            // use the prefix + class name if prefix is specified
+            name = configuration.getEntityPrefix() + mapping.getBeanClass().getSimpleName();
+        }
+        else
+        {
+            // default to fully qualified class name of bean
+            name = mapping.getBeanClass().getName();
+        }
+        mapping.getDescription().setNames( Collections.singletonList( name ) );
+
+        // by default we will presume top so heavy analysis of beanClass
+        // interfaces and class ancestors (superclasses) is not required
+        mapping.getDescription().addSuperiorObjectClass( "top" );
     }
 
 
-    public ObjectClassDescription extractObjectClassDescription( Class beanClass )
+    private ObjectClassTypeEnum getObjectClassType( Class beanClass )
     {
-        ObjectClassDescription objectClassDescriptions = new ObjectClassDescription();
+        if ( beanClass.isInterface() )
+        {
+            return ObjectClassTypeEnum.AUXILIARY;
+        }
+
+        if ( Modifier.isAbstract( beanClass.getModifiers() ) )
+        {
+            return ObjectClassTypeEnum.ABSTRACT;
+        }
 
-        return objectClassDescriptions;
+        return ObjectClassTypeEnum.STRUCTURAL;
     }
 }

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassToBeanMapping.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassToBeanMapping.java?view=auto&rev=564040
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassToBeanMapping.java (added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/ObjectClassToBeanMapping.java Wed Aug  8 15:59:04 2007
@@ -0,0 +1,111 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.j2l.descriptions;
+
+
+import org.apache.directory.shared.ldap.schema.syntax.ObjectClassDescription;
+
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.lang.annotation.Annotation;
+
+
+/**
+ * A mapping data structure used by the runtime to track bean to
+ * objectClass mapping information.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ObjectClassToBeanMapping
+{
+    private final Class beanClass;
+    private final ObjectClassDescription description;
+    private final List<AttributeToPropertyMapping> propertyMappings;
+    private final Map<Class, Annotation> annotations = new HashMap<Class, Annotation>();
+
+    
+    // ----- Constructors ----------------------------------------------------
+
+
+    /**
+     * Creates a mapping with a new ObjectClassDescription.
+     *
+     * @param beanClass the class of the bean being mapped
+     */
+    public ObjectClassToBeanMapping( Class beanClass, List<AttributeToPropertyMapping> propertyMappings )
+    {
+        this( beanClass, new ObjectClassDescription(), propertyMappings );
+    }
+
+
+    /**
+     * Creates a mapping with an existing ObjectClassDescription.
+     *
+     * @param beanClass the class of the bean being mapped
+     * @param description the objectClass description to use for this mapping
+     */
+    public ObjectClassToBeanMapping( Class beanClass,
+                                     ObjectClassDescription description,
+                                     List<AttributeToPropertyMapping> propertyMappings )
+    {
+        this.beanClass = beanClass;
+
+        for ( Annotation annotation : beanClass.getAnnotations() )
+        {
+            annotations.put( annotation.getClass(), annotation );
+        }
+        
+        this.description = description;
+        this.propertyMappings = propertyMappings;
+    }
+
+
+    // ----- Final member accessors ------------------------------------------
+
+
+    /**
+     * Gets the Class of the bean being mapped.
+     *
+     * @return the Class of the bean being mapped
+     */
+    public Class getBeanClass()
+    {
+        return beanClass;
+    }
+
+
+    /**
+     * Gets the objectClass description for this mapping.
+     *
+     * @return the objectClass description for this mapping
+     */
+    public ObjectClassDescription getDescription()
+    {
+        return description;
+    }
+
+
+    public List<AttributeToPropertyMapping> getPropertyMappings()
+    {
+        return propertyMappings;
+    }
+}



Mime
View raw message