commits@directory.apache.org
[Top] [All Lists]

svn commit: r568152 - /directory/studio/trunk/studio-apacheds-schemaedit

Subject: svn commit: r568152 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java
From:
Date: Tue, 21 Aug 2007 14:53:10 -0000
Author: pamarcelot
Date: Tue Aug 21 07:53:09 2007
New Revision: 568152

URL: http://svn.apache.org/viewvc?rev=568152&view=rev
Log:
Added implementation for the getAttributeType, getObjectClass, getSyntax and 
getMatchingRule methods.

Modified:
    
directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java

Modified: 
directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java
URL: 
http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java?rev=568152&r1=568151&r2=568152&view=diff
==============================================================================
--- 
directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java
 (original)
+++ 
directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java
 Tue Aug 21 07:53:09 2007
@@ -101,7 +101,25 @@
      */
     public AttributeTypeImpl getAttributeType( String id )
     {
-        // TODO Auto-generated method stub
+        for ( AttributeTypeImpl at : attributeTypes )
+        {
+            String[] aliases = at.getNames();
+            if ( aliases != null )
+            {
+                for ( String alias : aliases )
+                {
+                    if ( alias.equalsIgnoreCase( id ) )
+                    {
+                        return at;
+                    }
+                }
+            }
+            if ( at.getOid().equalsIgnoreCase( id ) )
+            {
+                return at;
+            }
+        }
+
         return null;
     }
 
@@ -120,7 +138,25 @@
      */
     public MatchingRuleImpl getMatchingRule( String id )
     {
-        // TODO Auto-generated method stub
+        for ( MatchingRuleImpl mr : matchingRules )
+        {
+            String[] aliases = mr.getNames();
+            if ( aliases != null )
+            {
+                for ( String alias : aliases )
+                {
+                    if ( alias.equalsIgnoreCase( id ) )
+                    {
+                        return mr;
+                    }
+                }
+            }
+            if ( mr.getOid().equalsIgnoreCase( id ) )
+            {
+                return mr;
+            }
+        }
+
         return null;
     }
 
@@ -148,7 +184,25 @@
      */
     public ObjectClassImpl getObjectClass( String id )
     {
-        // TODO Auto-generated method stub
+        for ( ObjectClassImpl oc : objectClasses )
+        {
+            String[] aliases = oc.getNames();
+            if ( aliases != null )
+            {
+                for ( String alias : aliases )
+                {
+                    if ( alias.equalsIgnoreCase( id ) )
+                    {
+                        return oc;
+                    }
+                }
+            }
+            if ( oc.getOid().equalsIgnoreCase( id ) )
+            {
+                return oc;
+            }
+        }
+
         return null;
     }
 
@@ -167,7 +221,25 @@
      */
     public SyntaxImpl getSyntax( String id )
     {
-        // TODO Auto-generated method stub
+        for ( SyntaxImpl syntax : syntaxes )
+        {
+            String[] aliases = syntax.getNames();
+            if ( aliases != null )
+            {
+                for ( String alias : aliases )
+                {
+                    if ( alias.equalsIgnoreCase( id ) )
+                    {
+                        return syntax;
+                    }
+                }
+            }
+            if ( syntax.getOid().equalsIgnoreCase( id ) )
+            {
+                return syntax;
+            }
+        }
+
         return null;
     }
 


<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: r568152 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java, pamarcelot <=