directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r775487 - /directory/apacheds/trunk/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/AttributeTypes.template
Date Sat, 16 May 2009 15:30:02 GMT
Author: elecharny
Date: Sat May 16 15:30:00 2009
New Revision: 775487

URL: http://svn.apache.org/viewvc?rev=775487&view=rev
Log:
Improved the code generation for AttributeTypes, adding the ASF header, the class header and
some javadoc + comments

Modified:
    directory/apacheds/trunk/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/AttributeTypes.template

Modified: directory/apacheds/trunk/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/AttributeTypes.template
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/AttributeTypes.template?rev=775487&r1=775486&r2=775487&view=diff
==============================================================================
--- directory/apacheds/trunk/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/AttributeTypes.template
(original)
+++ directory/apacheds/trunk/core-plugin/src/main/resources/org/apache/directory/server/core/tools/schema/AttributeTypes.template
Sat May 16 15:30:00 2009
@@ -17,20 +17,39 @@
  *  under the License. 
  *  
  *#
+/*
+ *  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 $package;
 
 
 import java.util.ArrayList;
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.schema.*;
-import org.apache.directory.server.schema.registries.*;
+import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.UsageEnum;
 
 #if ( $package != "org.apache.directory.server.schema.bootstrap" )
 import org.apache.directory.server.schema.bootstrap.*;
 #end
 
-#**
+/**
  * A producer of schema attributeType definations for the $schema schema.  This
  * code has been automatically generated using schema files in the OpenLDAP
  * format along with the directory plugin for maven.  This has been done
@@ -38,7 +57,7 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
- *#
+ */
 public class $classname extends AbstractBootstrapProducer
 {
 
@@ -48,29 +67,29 @@
     }
 
 
-    ## ------------------------------------------------------------------------
-    ## BootstrapProducer Methods
-    ## ------------------------------------------------------------------------
+    // ------------------------------------------------------------------------
+    // BootstrapProducer Methods
+    // ------------------------------------------------------------------------
 
 
-    #**
+    /**
      * @see BootstrapProducer#produce( Registries, ProducerCallback )
-     *#
+     */
     public void produce( Registries registries, ProducerCallback cb )
         throws NamingException
     {
         ArrayList<String> names = new ArrayList<String>();
         BootstrapAttributeType attributeType;
 
-        #foreach ( $attrType in $attrTypes )
+#foreach ( $attrType in $attrTypes )
 
-        ## --------------------------------------------------------------------
-        ## AttributeType $attrType.getOid() $!attrType.getName()
-        ## --------------------------------------------------------------------
+        // --------------------------------------------------------------------
+        // AttributeType $attrType.getOid() $!attrType.getName()
+        // --------------------------------------------------------------------
 
         attributeType = newAttributeType( "$attrType.getOid()", registries );
 #if ( $attrType.getDescription() )
-        #set( $desc = $attrType.getDescription().replaceAll("\"", "\\\"") )
+#set( $desc = $attrType.getDescription().replaceAll("\"", "\\\"") )
         attributeType.setDescription( "$desc" );
 #end
         attributeType.setCanUserModify( ! $attrType.isNoUserModification() );
@@ -79,22 +98,32 @@
         attributeType.setObsolete( $attrType.isObsolete() );
         attributeType.setLength( $attrType.getLength() );
         attributeType.setUsage( UsageEnum.getUsage( "$attrType.getUsage()" ) );
-#if ( $attrType.getSuperior() )        attributeType.setSuperiorId( "$attrType.getSuperior()"
); #end
-#if ( $attrType.getEquality() )        attributeType.setEqualityId( "$attrType.getEquality()"
);
+#if ( $attrType.getSuperior() )
+        attributeType.setSuperiorId( "$attrType.getSuperior()" );
+#end
+#if ( $attrType.getEquality() )
+        attributeType.setEqualityId( "$attrType.getEquality()" );
+#end
+#if ( $attrType.getSubstr() )
+        attributeType.setSubstrId( "$attrType.getSubstr()" );
+#end
+#if ( $attrType.getOrdering() )
+        attributeType.setOrderingId( "$attrType.getOrdering()" );
+#end
+#if ( $attrType.getSyntax() )
+        attributeType.setSyntaxId( "$attrType.getSyntax()" );
 #end
-#if ( $attrType.getSubstr() )        attributeType.setSubstrId( "$attrType.getSubstr()" );#end
-#if ( $attrType.getOrdering() )        attributeType.setOrderingId( "$attrType.getOrdering()"
);#end
-#if ( $attrType.getSyntax() )        attributeType.setSyntaxId( "$attrType.getSyntax()" );#end
-
-        #if ( $attrType.getNames() )
-names.clear();
-       #foreach ( $name in $attrType.getNames() ) names.add( "$name" );
-       #end
- attributeType.setNames( names.toArray( EMPTY ) );
-        #else
- attributeType.setNames( EMPTY );
-        #end
-cb.schemaObjectProduced( this, "$attrType.getOid()", attributeType );
 
- #end   }
+#if ( $attrType.getNames() )
+        names.clear();
+#foreach ( $name in $attrType.getNames() )
+        names.add( "$name" );
+#end
+        attributeType.setNames( names.toArray( EMPTY ) );
+#else
+        attributeType.setNames( EMPTY );
+#end
+        cb.schemaObjectProduced( this, "$attrType.getOid()", attributeType );
+#end
+    }
 }



Mime
View raw message