directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r801332 [5/5] - in /directory/shared/trunk: cursor/src/main/java/org/apache/directory/shared/ldap/cursor/ cursor/src/test/java/org/apache/directory/shared/ldap/cursor/ ldap-jndi/src/main/java/org/apache/directory/shared/ldap/jndi/ ldap/src/...
Date Wed, 05 Aug 2009 17:40:51 GMT
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java?rev=801332&r1=801331&r2=801332&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java
Wed Aug  5 17:40:50 2009
@@ -1,140 +1,140 @@
-/*
- * 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.shared.ldap.util;
-
-
-import javax.naming.directory.Attribute;
-import javax.naming.directory.DirContext;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-
-/**
- * A read only wrapper around an Attributes object.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$, $Date$
- */
-public class ImmutableAttributeWrapper implements Attribute
-{
-    private final Attribute wrapped;
-
-
-    public ImmutableAttributeWrapper( Attribute wrapped )
-    {
-        this.wrapped = wrapped;
-    }
-
-
-    public NamingEnumeration<?> getAll() throws NamingException
-    {
-        return wrapped.getAll();
-    }
-
-
-    public Object get() throws NamingException
-    {
-        return wrapped.get();
-    }
-
-
-    public int size()
-    {
-        return wrapped.size();
-    }
-
-
-    public String getID()
-    {
-        return wrapped.getID();
-    }
-
-
-    public boolean contains( Object attrVal )
-    {
-        return wrapped.contains( attrVal );
-    }
-
-
-    public boolean add( Object attrVal )
-    {
-        throw new UnsupportedOperationException( "Value addition not supported for immutable
attribute" );
-    }
-
-
-    public boolean remove( Object attrval )
-    {
-        throw new UnsupportedOperationException( "Value removal not supported for immutable
attribute" );
-    }
-
-
-    public void clear()
-    {
-        throw new UnsupportedOperationException( "Clearing all values not supported for immutable
attribute" );
-    }
-
-
-    public DirContext getAttributeSyntaxDefinition() throws NamingException
-    {
-        return wrapped.getAttributeSyntaxDefinition();
-    }
-
-
-    public DirContext getAttributeDefinition() throws NamingException
-    {
-        return wrapped.getAttributeDefinition();
-    }
-
-
-    @SuppressWarnings ( { "CloneDoesntCallSuperClone" } )
-    public Object clone()
-    {
-        throw new IllegalStateException( "Now why would you ever want to clone an immutable
object?" );
-    }
-
-
-    public boolean isOrdered()
-    {
-        return wrapped.isOrdered();
-    }
-
-
-    public Object get( int ix ) throws NamingException
-    {
-        return wrapped.get( ix );
-    }
-
-
-    public Object remove( int ix )
-    {
-        throw new UnsupportedOperationException( "Value removal not supported for immutable
attribute" );
-    }
-
-
-    public void add( int ix, Object attrVal )
-    {
-        throw new UnsupportedOperationException( "Value addition not supported for immutable
attribute" );
-    }
-
-
-    public Object set( int ix, Object attrVal )
-    {
-        throw new UnsupportedOperationException( "Value alteration is not supported for immutable
attribute" );
-    }
-}
+/*
+ * 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.shared.ldap.util;
+
+
+import javax.naming.directory.Attribute;
+import javax.naming.directory.DirContext;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+
+/**
+ * A read only wrapper around an Attributes object.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ImmutableAttributeWrapper implements Attribute
+{
+    private final Attribute wrapped;
+
+
+    public ImmutableAttributeWrapper( Attribute wrapped )
+    {
+        this.wrapped = wrapped;
+    }
+
+
+    public NamingEnumeration<?> getAll() throws NamingException
+    {
+        return wrapped.getAll();
+    }
+
+
+    public Object get() throws NamingException
+    {
+        return wrapped.get();
+    }
+
+
+    public int size()
+    {
+        return wrapped.size();
+    }
+
+
+    public String getID()
+    {
+        return wrapped.getID();
+    }
+
+
+    public boolean contains( Object attrVal )
+    {
+        return wrapped.contains( attrVal );
+    }
+
+
+    public boolean add( Object attrVal )
+    {
+        throw new UnsupportedOperationException( "Value addition not supported for immutable
attribute" );
+    }
+
+
+    public boolean remove( Object attrval )
+    {
+        throw new UnsupportedOperationException( "Value removal not supported for immutable
attribute" );
+    }
+
+
+    public void clear()
+    {
+        throw new UnsupportedOperationException( "Clearing all values not supported for immutable
attribute" );
+    }
+
+
+    public DirContext getAttributeSyntaxDefinition() throws NamingException
+    {
+        return wrapped.getAttributeSyntaxDefinition();
+    }
+
+
+    public DirContext getAttributeDefinition() throws NamingException
+    {
+        return wrapped.getAttributeDefinition();
+    }
+
+
+    @SuppressWarnings ( { "CloneDoesntCallSuperClone" } )
+    public Object clone()
+    {
+        throw new IllegalStateException( "Now why would you ever want to clone an immutable
object?" );
+    }
+
+
+    public boolean isOrdered()
+    {
+        return wrapped.isOrdered();
+    }
+
+
+    public Object get( int ix ) throws NamingException
+    {
+        return wrapped.get( ix );
+    }
+
+
+    public Object remove( int ix )
+    {
+        throw new UnsupportedOperationException( "Value removal not supported for immutable
attribute" );
+    }
+
+
+    public void add( int ix, Object attrVal )
+    {
+        throw new UnsupportedOperationException( "Value addition not supported for immutable
attribute" );
+    }
+
+
+    public Object set( int ix, Object attrVal )
+    {
+        throw new UnsupportedOperationException( "Value alteration is not supported for immutable
attribute" );
+    }
+}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java?rev=801332&r1=801331&r2=801332&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java
Wed Aug  5 17:40:50 2009
@@ -1,140 +1,140 @@
-/*
- * 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.shared.ldap.util;
-
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-
-
-/**
- * Document me!
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$, $Date$
- */
-public class ImmutableAttributesWrapper implements Attributes
-{
-    private final Attributes wrapped;
-
-
-    public ImmutableAttributesWrapper( Attributes wrapped )
-    {
-        this.wrapped = wrapped;
-    }
-
-
-    public boolean isCaseIgnored()
-    {
-        return wrapped.isCaseIgnored();
-    }
-
-
-    public int size()
-    {
-        return wrapped.size();
-    }
-
-
-    public Attribute get( String attrID )
-    {
-        return new ImmutableAttributeWrapper( wrapped.get( attrID ) );
-    }
-
-
-    public NamingEnumeration<? extends Attribute> getAll()
-    {
-        return new ImmutableEnumeration( wrapped.getAll() );
-    }
-
-
-    public NamingEnumeration<String> getIDs()
-    {
-        return wrapped.getIDs();
-    }
-
-
-    public Attribute put( String attrID, Object val )
-    {
-        throw new UnsupportedOperationException( "Putting attributes not supported by immutable
attributes" );
-    }
-
-
-    public Attribute put( Attribute attr )
-    {
-        throw new UnsupportedOperationException( "Putting attributes not supported by immutable
attributes" );
-    }
-
-
-    public Attribute remove( String attrID )
-    {
-        throw new UnsupportedOperationException( "Removing attributes not supported by immutable
attributes" );
-    }
-
-
-    @SuppressWarnings ( { "CloneDoesntCallSuperClone" } )
-    public Object clone()
-    {
-        throw new IllegalStateException( "Now why would you want to clone() an immutable
object in the first place." );
-    }
-
-
-    class ImmutableEnumeration implements NamingEnumeration
-    {
-        private NamingEnumeration wrappedEnum;
-
-
-        public ImmutableEnumeration( NamingEnumeration<? extends Attribute> all )
-        {
-            wrappedEnum = all;
-        }
-
-
-        public Attribute next() throws NamingException
-        {
-            return new ImmutableAttributeWrapper( ( Attribute ) wrappedEnum.next() );
-        }
-
-
-        public boolean hasMore() throws NamingException
-        {
-            return wrappedEnum.hasMore();
-        }
-
-
-        public void close() throws NamingException
-        {
-            wrappedEnum.close();
-        }
-
-
-        public boolean hasMoreElements()
-        {
-            return wrappedEnum.hasMoreElements();
-        }
-
-
-        public Attribute nextElement()
-        {
-            return new ImmutableAttributeWrapper( ( Attribute ) wrappedEnum.nextElement()
);
-        }
-    }
-}
+/*
+ * 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.shared.ldap.util;
+
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+
+
+/**
+ * Document me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ImmutableAttributesWrapper implements Attributes
+{
+    private final Attributes wrapped;
+
+
+    public ImmutableAttributesWrapper( Attributes wrapped )
+    {
+        this.wrapped = wrapped;
+    }
+
+
+    public boolean isCaseIgnored()
+    {
+        return wrapped.isCaseIgnored();
+    }
+
+
+    public int size()
+    {
+        return wrapped.size();
+    }
+
+
+    public Attribute get( String attrID )
+    {
+        return new ImmutableAttributeWrapper( wrapped.get( attrID ) );
+    }
+
+
+    public NamingEnumeration<? extends Attribute> getAll()
+    {
+        return new ImmutableEnumeration( wrapped.getAll() );
+    }
+
+
+    public NamingEnumeration<String> getIDs()
+    {
+        return wrapped.getIDs();
+    }
+
+
+    public Attribute put( String attrID, Object val )
+    {
+        throw new UnsupportedOperationException( "Putting attributes not supported by immutable
attributes" );
+    }
+
+
+    public Attribute put( Attribute attr )
+    {
+        throw new UnsupportedOperationException( "Putting attributes not supported by immutable
attributes" );
+    }
+
+
+    public Attribute remove( String attrID )
+    {
+        throw new UnsupportedOperationException( "Removing attributes not supported by immutable
attributes" );
+    }
+
+
+    @SuppressWarnings ( { "CloneDoesntCallSuperClone" } )
+    public Object clone()
+    {
+        throw new IllegalStateException( "Now why would you want to clone() an immutable
object in the first place." );
+    }
+
+
+    class ImmutableEnumeration implements NamingEnumeration
+    {
+        private NamingEnumeration wrappedEnum;
+
+
+        public ImmutableEnumeration( NamingEnumeration<? extends Attribute> all )
+        {
+            wrappedEnum = all;
+        }
+
+
+        public Attribute next() throws NamingException
+        {
+            return new ImmutableAttributeWrapper( ( Attribute ) wrappedEnum.next() );
+        }
+
+
+        public boolean hasMore() throws NamingException
+        {
+            return wrappedEnum.hasMore();
+        }
+
+
+        public void close() throws NamingException
+        {
+            wrappedEnum.close();
+        }
+
+
+        public boolean hasMoreElements()
+        {
+            return wrappedEnum.hasMoreElements();
+        }
+
+
+        public Attribute nextElement()
+        {
+            return new ImmutableAttributeWrapper( ( Attribute ) wrappedEnum.nextElement()
);
+        }
+    }
+}



Mime
View raw message