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 2003/12/14 21:42:02 UTC

svn commit: rev 1424 - incubator/directory/ldap/trunk/eve/backend/schema/api/src/java/org/apache/eve/schema

Author: akarasulu
Date: Sun Dec 14 12:42:01 2003
New Revision: 1424

Modified:
   incubator/directory/ldap/trunk/eve/backend/schema/api/src/java/org/apache/eve/schema/DescriptionUtils.java
Log:
adding definition fuctions

Modified: incubator/directory/ldap/trunk/eve/backend/schema/api/src/java/org/apache/eve/schema/DescriptionUtils.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/backend/schema/api/src/java/org/apache/eve/schema/DescriptionUtils.java	(original)
+++ incubator/directory/ldap/trunk/eve/backend/schema/api/src/java/org/apache/eve/schema/DescriptionUtils.java	Sun Dec 14 12:42:01 2003
@@ -89,8 +89,65 @@
      */
     public String getDescription( AttributeType a_type ) 
     {
-        throw new NotImplementedException( 
-                "AttributeTypeDescription Syntax" ) ;
+        StringBuffer l_buf = new StringBuffer( "(\n" ) ;
+        l_buf.append( a_type.getOid() ).append( '\n' ) ;
+        
+        l_buf.append( "NAME " ) ;
+        l_buf.append( a_type.getName() ).append( '\n' ) ;
+        
+        if ( a_type.getDescription() != null )
+        {    
+            l_buf.append( "DESC " ) ;
+            l_buf.append( a_type.getDescription() ).append( '\n' ) ;
+        }
+        
+        if ( a_type.isObsolete() )
+        {    
+            l_buf.append( "OBSOLETE" ).append( '\n' ) ;
+        }
+        
+        l_buf.append( a_type.getSuperior().getOid() ) ;
+        
+        if ( a_type.getEquality() != null )
+        {
+            l_buf.append( "EQUALITY " ) ;
+            l_buf.append( a_type.getEquality().getOid() ).append( '\n' ) ;
+        }
+        
+        if ( a_type.getOrdering() != null )
+        {
+            l_buf.append( "ORDERING " ) ;
+            l_buf.append( a_type.getOrdering().getOid() ).append( '\n' ) ;
+        }
+        
+        if ( a_type.getSubstr() != null )
+        {
+            l_buf.append( "SUBSTR " ) ;
+            l_buf.append( a_type.getSubstr().getOid() ).append( '\n' ) ;
+        }
+        
+        l_buf.append( "SYNTAX " ) ;
+        l_buf.append( a_type.getSyntax().getOid() ).append( '\n' ) ;
+        
+        if ( a_type.isSingleValue() )
+        {
+            l_buf.append( "SINGLE-VALUE" ).append( '\n' ) ;
+        }
+        
+        if ( a_type.isCollective() )
+        {
+            l_buf.append( "COLLECTIVE" ).append( '\n' ) ;
+        }
+        
+        if ( a_type.isCanUserModify() )
+        {
+            l_buf.append( "NO-USER-MODIFICATION" ).append( '\n' ) ;
+        }
+        
+        l_buf.append( "USAGE " ) ;
+        l_buf.append( a_type.getUsage().getName() ).append( '\n' ) ;
+        
+        return l_buf.toString() ;
     }