You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/10/08 08:32:33 UTC
svn commit: rev 54066 - in incubator/directory/eve/trunk/backend/tools/src: java/org/apache/eve/tools/schema test/org/apache/eve/tools/schema
Author: akarasulu
Date: Thu Oct 7 23:32:32 2004
New Revision: 54066
Modified:
incubator/directory/eve/trunk/backend/tools/src/java/org/apache/eve/tools/schema/AttributeTypes.template
incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java
Log:
completed template for attribute types
Modified: incubator/directory/eve/trunk/backend/tools/src/java/org/apache/eve/tools/schema/AttributeTypes.template
==============================================================================
--- incubator/directory/eve/trunk/backend/tools/src/java/org/apache/eve/tools/schema/AttributeTypes.template (original)
+++ incubator/directory/eve/trunk/backend/tools/src/java/org/apache/eve/tools/schema/AttributeTypes.template Thu Oct 7 23:32:32 2004
@@ -41,6 +41,8 @@
*/
public class $classname implements AttributeTypeConfigSet
{
+ /** a reused empty String array */
+ private static final String[] EMPTY = new String[0];
/** the DN of the owner of the objects within this SyntaxConfigSet */
private static final String OWNER = "$owner";
/** the logical schema the objects within this SyntaxConfigSet belong to */
@@ -72,12 +74,10 @@
if ( schemaDeps == null )
{
schemaDeps = new String[$schemaDepCount];
-
#foreach ( $dep in $schemaDeps )
#set ( $ii = $velocityCount - 1 )
schemaDeps[$ii] = "$dep";
#end
-
}
return schemaDeps;
@@ -94,13 +94,14 @@
AttributeTypeRegistry attrTypeReg )
throws NamingException
{
+ ArrayList names = new ArrayList();
MutableAttributeType[] attributeTypes = new MutableAttributeType[$attrTypeCount];
#foreach ( $attrType in $attrTypes )
#set ( $ii = $velocityCount - 1 )
// --------------------------------------------------------------------
- // AttributeType $attrType.getOid()
+ // AttributeType $attrType.getOid() $!attrType.getName()
// --------------------------------------------------------------------
@@ -117,6 +118,13 @@
#if ( $attrType.getOrderingOid() ) attributeTypes[$ii].setOrdering( mruleReg.lookup( "$attrType.getOrderingOid()" ) );#end
#if ( $attrType.getSyntaxOid() ) attributeTypes[$ii].setSyntax( syntaxReg.lookup( "$attrType.getSyntaxOid()" ) );#end
+ #if ( $attrType.getAllNames() )
+names.clear();
+ #foreach ( $name in $attrType.getAllNames() ) names.add( "$name" );
+ #end
+ attributeTypes[$ii].setAllNames( ( String[] ) names.toArray( EMPTY ) );
+ #end
+
#end
return attributeTypes;
@@ -135,9 +143,9 @@
super.setSuperior( superior );
}
- protected void setNameList( ArrayList nameList )
+ protected void setAllNames( String[] nameArray )
{
- super.setNameList( nameList );
+ super.setAllNames( nameArray );
}
protected void setEquality( MatchingRule equality )
Modified: incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java
==============================================================================
--- incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java (original)
+++ incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java Thu Oct 7 23:32:32 2004
@@ -24,7 +24,6 @@
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
-import java.util.ArrayList;
/**
@@ -109,6 +108,7 @@
attributeTypes[0] = new TestAttributeType( "1.1.1.1" );
attributeTypes[0].setUsage( UsageEnum.USERAPPLICATIONS );
attributeTypes[0].setSyntax( syntax );
+ attributeTypes[0].setAllNames( new String[] { "commonName", "cn", "abc" } );
attributeTypes[1] = new TestAttributeType( "1.1.1.2" );
attributeTypes[1].setUsage( UsageEnum.DIRECTORYOPERATION );
@@ -145,9 +145,9 @@
super.setSuperior( superior );
}
- protected void setNameList( ArrayList nameList )
+ protected void setAllNames( String[] names )
{
- super.setNameList( nameList );
+ super.setAllNames( names );
}
protected void setEquality( MatchingRule equality )