Return-Path: X-Original-To: apmail-onami-commits-archive@minotaur.apache.org Delivered-To: apmail-onami-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF681D7E7 for ; Sun, 2 Dec 2012 23:34:54 +0000 (UTC) Received: (qmail 48578 invoked by uid 500); 2 Dec 2012 23:34:54 -0000 Delivered-To: apmail-onami-commits-archive@onami.apache.org Received: (qmail 48549 invoked by uid 500); 2 Dec 2012 23:34:54 -0000 Mailing-List: contact commits-help@onami.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@onami.incubator.apache.org Delivered-To: mailing list commits@onami.incubator.apache.org Received: (qmail 48541 invoked by uid 99); 2 Dec 2012 23:34:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Dec 2012 23:34:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Dec 2012 23:34:33 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B258E2388CBD; Sun, 2 Dec 2012 23:32:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1416291 [43/48] - in /incubator/onami/site/configuration: ./ apidocs/ apidocs/assets/ apidocs/assets/images/ apidocs/reference/ apidocs/reference/org/ apidocs/reference/org/apache/ apidocs/reference/org/apache/onami/ apidocs/reference/org/... Date: Sun, 02 Dec 2012 23:32:26 -0000 To: commits@onami.incubator.apache.org From: olamy@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121202233249.B258E2388CBD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: incubator/onami/site/configuration/xref/allclasses-frame.html URL: http://svn.apache.org/viewvc/incubator/onami/site/configuration/xref/allclasses-frame.html?rev=1416291&view=auto ============================================================================== --- incubator/onami/site/configuration/xref/allclasses-frame.html (added) +++ incubator/onami/site/configuration/xref/allclasses-frame.html Sun Dec 2 23:31:59 2012 @@ -0,0 +1,134 @@ + + + + + + All Classes + + + + +

All Classes

+ + + + + \ No newline at end of file Propchange: incubator/onami/site/configuration/xref/allclasses-frame.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/onami/site/configuration/xref/allclasses-frame.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: incubator/onami/site/configuration/xref/index.html URL: http://svn.apache.org/viewvc/incubator/onami/site/configuration/xref/index.html?rev=1416291&view=auto ============================================================================== --- incubator/onami/site/configuration/xref/index.html (added) +++ incubator/onami/site/configuration/xref/index.html Sun Dec 2 23:31:59 2012 @@ -0,0 +1,23 @@ + + + + + + Apache Onami-Configuration 6.3-SNAPSHOT-incubating Reference + + + + + + + + + <body> + <h1>Frame Alert</h1> + <p> + You don't have frames. Go <a href="overview-summary.html">here</a> + </p> + </body> + + + Propchange: incubator/onami/site/configuration/xref/index.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/onami/site/configuration/xref/index.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: incubator/onami/site/configuration/xref/org/apache/onami/configuration/Rocoto.html URL: http://svn.apache.org/viewvc/incubator/onami/site/configuration/xref/org/apache/onami/configuration/Rocoto.html?rev=1416291&view=auto ============================================================================== --- incubator/onami/site/configuration/xref/org/apache/onami/configuration/Rocoto.html (added) +++ incubator/onami/site/configuration/xref/org/apache/onami/configuration/Rocoto.html Sun Dec 2 23:31:59 2012 @@ -0,0 +1,129 @@ + + + + +Rocoto xref + + + +
+
+1   package org.apache.onami.configuration;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one or more
+5    * contributor license agreements.  See the NOTICE file distributed with
+6    * this work for additional information regarding copyright ownership.
+7    * The ASF licenses this file to You under the Apache License, Version 2.0
+8    * (the "License"); you may not use this file except in compliance with
+9    * the License.  You may obtain a copy of the License at
+10   *
+11   *  http://www.apache.org/licenses/LICENSE-2.0
+12   *
+13   * Unless required by applicable law or agreed to in writing, software
+14   * distributed under the License is distributed on an "AS IS" BASIS,
+15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+16   * See the License for the specific language governing permissions and
+17   * limitations under the License.
+18   */
+19  
+20  import static com.google.inject.name.Names.named;
+21  import static com.google.inject.spi.Elements.getElements;
+22  import static com.google.inject.util.Modules.override;
+23  import static java.util.Arrays.asList;
+24  
+25  import java.util.List;
+26  import java.util.Map.Entry;
+27  
+28  import org.apache.onami.configuration.variables.VariablesMap;
+29  
+30  import com.google.inject.AbstractModule;
+31  import com.google.inject.Binding;
+32  import com.google.inject.Key;
+33  import com.google.inject.Module;
+34  import com.google.inject.TypeLiteral;
+35  import com.google.inject.name.Named;
+36  import com.google.inject.spi.DefaultElementVisitor;
+37  import com.google.inject.spi.Element;
+38  
+39  /**
+40   * @since 6.0
+41   */
+42  public final class Rocoto
+43      extends AbstractModule
+44  {
+45  
+46      public static Module expandVariables( Module...baseModules )
+47      {
+48          return expandVariables( asList( baseModules ) );
+49      }
+50  
+51      public static Module expandVariables( Iterable<? extends Module> baseModules )
+52      {
+53          return override( baseModules ).with( new Rocoto( getElements( baseModules ) ) );
+54      }
+55  
+56      private final TypeLiteral<String> stringLiteral = new TypeLiteral<String>(){};
+57  
+58      private final List<Element> elements;
+59  
+60      /**
+61       * Do nothing, this class cannot be instantiated
+62       */
+63      private Rocoto( List<Element> elements )
+64      {
+65          this.elements = elements;
+66      }
+67  
+68      @Override
+69      protected void configure()
+70      {
+71          final VariablesMap variablesMap = new VariablesMap();
+72  
+73          for ( final Element element : elements )
+74          {
+75              element.acceptVisitor( new DefaultElementVisitor<Void>()
+76              {
+77  
+78                  @Override
+79                  public <T> Void visit( Binding<T> binding )
+80                  {
+81                      Key<?> bindingKey = binding.getKey();
+82  
+83                      if ( stringLiteral.equals( bindingKey.getTypeLiteral() )
+84                              && bindingKey.getAnnotation() != null
+85                              && ( Named.class.isAssignableFrom( bindingKey.getAnnotationType() )
+86                                              || javax.inject.Named.class.isAssignableFrom( bindingKey.getAnnotationType() ) ) )
+87                      {
+88                          String propertyKey;
+89  
+90                          if ( Named.class.isAssignableFrom( bindingKey.getAnnotationType() ) )
+91                          {
+92                              propertyKey = ( (Named) bindingKey.getAnnotation() ).value();
+93                          }
+94                          else
+95                          {
+96                              propertyKey = ( (javax.inject.Named) bindingKey.getAnnotation() ).value();
+97                          }
+98  
+99                          String propertyValue = (String) binding.getProvider().get();
+100 
+101                         variablesMap.put( propertyKey, propertyValue );
+102                     }
+103 
+104                     return super.visit( binding );
+105                 }
+106 
+107             });
+108         }
+109 
+110         for ( Entry<String, String> variable : variablesMap.entrySet() )
+111         {
+112             bindConstant().annotatedWith( named( variable.getKey() ) ).to( variable.getValue() );
+113         }
+114     }
+115 
+116 }
+
+
+ Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/Rocoto.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/Rocoto.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/ConfigurationModule.html URL: http://svn.apache.org/viewvc/incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/ConfigurationModule.html?rev=1416291&view=auto ============================================================================== --- incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/ConfigurationModule.html (added) +++ incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/ConfigurationModule.html Sun Dec 2 23:31:59 2012 @@ -0,0 +1,292 @@ + + + + +ConfigurationModule xref + + + +
+
+1   package org.apache.onami.configuration.configuration;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one or more
+5    * contributor license agreements.  See the NOTICE file distributed with
+6    * this work for additional information regarding copyright ownership.
+7    * The ASF licenses this file to You under the Apache License, Version 2.0
+8    * (the "License"); you may not use this file except in compliance with
+9    * the License.  You may obtain a copy of the License at
+10   *
+11   *  http://www.apache.org/licenses/LICENSE-2.0
+12   *
+13   * Unless required by applicable law or agreed to in writing, software
+14   * distributed under the License is distributed on an "AS IS" BASIS,
+15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+16   * See the License for the specific language governing permissions and
+17   * limitations under the License.
+18   */
+19  
+20  import static com.google.inject.internal.util.$Preconditions.checkNotNull;
+21  import static com.google.inject.internal.util.$Preconditions.checkState;
+22  import static com.google.inject.name.Names.named;
+23  import static java.lang.String.format;
+24  import static org.apache.onami.configuration.configuration.PropertiesIterator.newPropertiesIterator;
+25  
+26  import java.io.File;
+27  import java.net.MalformedURLException;
+28  import java.net.URI;
+29  import java.net.URL;
+30  import java.util.Iterator;
+31  import java.util.LinkedList;
+32  import java.util.List;
+33  import java.util.Map;
+34  import java.util.Map.Entry;
+35  import java.util.Properties;
+36  
+37  import org.apache.onami.configuration.configuration.binder.PropertyValueBindingBuilder;
+38  import org.apache.onami.configuration.configuration.binder.XMLPropertiesFormatBindingBuilder;
+39  
+40  import com.google.inject.AbstractModule;
+41  import com.google.inject.ProvisionException;
+42  
+43  /**
+44   * The ConfigurationModule simplifies the task of loading configurations in Google Guice.
+45   */
+46  public abstract class ConfigurationModule
+47      extends AbstractModule
+48  {
+49  
+50      /**
+51       * The environment variable prefix, {@code env.}
+52       */
+53      private static final String ENV_PREFIX = "env.";
+54  
+55      /**
+56       * The {@code classpath} URL scheme constant
+57       */
+58      private static final String CLASSPATH_SCHEME = "classpath";
+59  
+60      private List<PropertiesURLReader> readers;
+61  
+62      @Override
+63      protected final void configure()
+64      {
+65          checkState( readers == null, "Re-entry not allowed" );
+66  
+67          readers = new LinkedList<PropertiesURLReader>();
+68  
+69          bindConfigurations();
+70  
+71          try
+72          {
+73              for ( PropertiesURLReader reader : readers )
+74              {
+75                  try
+76                  {
+77                      bindProperties( reader.readConfiguration() );
+78                  }
+79                  catch ( Exception e )
+80                  {
+81                      addError( "An error occurred while reading properties from '%s': %s", reader.getUrl(),
+82                                e.getMessage() );
+83                  }
+84              }
+85          }
+86          finally
+87          {
+88              readers = null;
+89          }
+90      }
+91  
+92      /**
+93       *
+94       */
+95      protected abstract void bindConfigurations();
+96  
+97      /**
+98       * Binds to a property with the given name.
+99       *
+100      * @param name The property name
+101      * @return The property value binder
+102      */
+103     protected PropertyValueBindingBuilder bindProperty( final String name )
+104     {
+105         checkNotNull( name, "Property name cannot be null." );
+106 
+107         return new PropertyValueBindingBuilder()
+108         {
+109 
+110             public void toValue( final String value )
+111             {
+112                 checkNotNull( value, "Null value not admitted for property '%s's", name );
+113 
+114                 bindConstant().annotatedWith( named( name ) ).to( value );
+115             }
+116 
+117         };
+118     }
+119 
+120     /**
+121      *
+122      * @param properties
+123      * @return
+124      */
+125     protected void bindProperties( Properties properties )
+126     {
+127         checkNotNull( properties, "Parameter 'properties' must be not null" );
+128 
+129         bindProperties( newPropertiesIterator( properties ) );
+130     }
+131 
+132     /**
+133      *
+134      * @param properties
+135      */
+136     protected void bindProperties( Iterable<Entry<String, String>> properties )
+137     {
+138         checkNotNull( properties, "Parameter 'properties' must be not null" );
+139 
+140         bindProperties( properties.iterator() );
+141     }
+142 
+143     /**
+144      *
+145      * @param properties
+146      */
+147     protected void bindProperties( Iterator<Entry<String, String>> properties )
+148     {
+149         checkNotNull( properties, "Parameter 'properties' must be not null" );
+150 
+151         while ( properties.hasNext() )
+152         {
+153             Entry<String, String> property = properties.next();
+154             bindProperty( property.getKey() ).toValue( property.getValue() );
+155         }
+156     }
+157 
+158     /**
+159      * Add the Environment Variables properties, prefixed by {@code env.}.
+160      */
+161     protected void bindSystemProperties()
+162     {
+163         bindProperties( System.getProperties() );
+164     }
+165 
+166     /**
+167      *
+168      * @param properties
+169      * @return
+170      */
+171     protected void bindProperties( Map<String, String> properties )
+172     {
+173         checkNotNull( properties, "Parameter 'properties' must be not null" );
+174 
+175         bindProperties( newPropertiesIterator( properties ) );
+176     }
+177 
+178     /**
+179      * Add the System Variables properties.
+180      */
+181     protected void bindEnvironmentVariables()
+182     {
+183         bindProperties( newPropertiesIterator( ENV_PREFIX, System.getenv() ) );
+184     }
+185 
+186     /**
+187      *
+188      *
+189      * @param propertiesResource
+190      * @return
+191      */
+192     protected XMLPropertiesFormatBindingBuilder bindProperties( final File propertiesResource )
+193     {
+194         checkNotNull( propertiesResource, "Parameter 'propertiesResource' must be not null" );
+195 
+196         return bindProperties( propertiesResource.toURI() );
+197     }
+198 
+199     /**
+200      *
+201      *
+202      * @param propertiesResource
+203      * @return
+204      */
+205     protected XMLPropertiesFormatBindingBuilder bindProperties( final URI propertiesResource )
+206     {
+207         checkNotNull( propertiesResource, "Parameter 'propertiesResource' must be not null" );
+208 
+209         if ( CLASSPATH_SCHEME.equals( propertiesResource.getScheme() ) )
+210         {
+211             String path = propertiesResource.getPath();
+212             if ( propertiesResource.getHost() != null )
+213             {
+214                 path = propertiesResource.getHost() + path;
+215             }
+216             return bindProperties( path );
+217         }
+218 
+219         try
+220         {
+221             return bindProperties( propertiesResource.toURL() );
+222         }
+223         catch ( MalformedURLException e )
+224         {
+225             throw new ProvisionException( format( "URI '%s' not supported: %s", propertiesResource, e.getMessage() ) );
+226         }
+227     }
+228 
+229     /**
+230      *
+231      * @param classPathResource
+232      * @return
+233      */
+234     protected XMLPropertiesFormatBindingBuilder bindProperties( final String classPathResource )
+235     {
+236         return bindProperties( classPathResource, getClass().getClassLoader() );
+237     }
+238 
+239     /**
+240      *
+241      * @param classPathResource
+242      * @param classLoader
+243      * @return
+244      */
+245     protected XMLPropertiesFormatBindingBuilder bindProperties( final String classPathResource,
+246                                                                 final ClassLoader classLoader )
+247     {
+248         checkNotNull( classPathResource, "Parameter 'classPathResource' must be not null" );
+249         checkNotNull( classLoader, "Parameter 'classLoader' must be not null" );
+250 
+251         String resourceURL = classPathResource;
+252         if ( '/' == classPathResource.charAt( 0 ) )
+253         {
+254             resourceURL = classPathResource.substring( 1 );
+255         }
+256 
+257         URL url = classLoader.getResource( resourceURL );
+258         checkNotNull( url,
+259                       "ClassPath resource '%s' not found, make sure it is in the ClassPath or you're using the right ClassLoader",
+260                       classPathResource );
+261 
+262         return bindProperties( url );
+263     }
+264 
+265     /**
+266      *
+267      * @param propertiesResource
+268      * @return
+269      */
+270     protected XMLPropertiesFormatBindingBuilder bindProperties( final URL propertiesResource )
+271     {
+272         checkNotNull( propertiesResource, "parameter 'propertiesResource' must not be null" );
+273 
+274         PropertiesURLReader reader = new PropertiesURLReader( propertiesResource );
+275         readers.add( reader );
+276         return reader;
+277     }
+278 
+279 }
+
+
+ Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/ConfigurationModule.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/ConfigurationModule.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/KeyValue.html URL: http://svn.apache.org/viewvc/incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/KeyValue.html?rev=1416291&view=auto ============================================================================== --- incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/KeyValue.html (added) +++ incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/KeyValue.html Sun Dec 2 23:31:59 2012 @@ -0,0 +1,88 @@ + + + + +KeyValue xref + + + +
+
+1   package org.apache.onami.configuration.configuration;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one or more
+5    * contributor license agreements.  See the NOTICE file distributed with
+6    * this work for additional information regarding copyright ownership.
+7    * The ASF licenses this file to You under the Apache License, Version 2.0
+8    * (the "License"); you may not use this file except in compliance with
+9    * the License.  You may obtain a copy of the License at
+10   *
+11   *  http://www.apache.org/licenses/LICENSE-2.0
+12   *
+13   * Unless required by applicable law or agreed to in writing, software
+14   * distributed under the License is distributed on an "AS IS" BASIS,
+15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+16   * See the License for the specific language governing permissions and
+17   * limitations under the License.
+18   */
+19  
+20  import java.util.Map.Entry;
+21  
+22  /**
+23   * A simple {@code Entry<String, String>} implementation.
+24   */
+25  final class KeyValue
+26      implements Entry<String, String>
+27  {
+28  
+29      /**
+30       * The entry key.
+31       */
+32      private final String key;
+33  
+34      /**
+35       * The entry value.
+36       */
+37      private final String value;
+38  
+39      /**
+40       * Creates a new {@code Entry<String, String>}.
+41       *
+42       * @param key the entry key.
+43       * @param value the entry value.
+44       */
+45      public KeyValue( String key, String value )
+46      {
+47          this.key = key;
+48          this.value = value;
+49      }
+50  
+51      /**
+52       * {@inheritDoc}
+53       */
+54      public String getKey()
+55      {
+56          return key;
+57      }
+58  
+59      /**
+60       * {@inheritDoc}
+61       */
+62      public String getValue()
+63      {
+64          return value;
+65      }
+66  
+67      /**
+68       * {@inheritDoc}
+69       */
+70      public String setValue( String value )
+71      {
+72          throw new UnsupportedOperationException( "Value is read-only in this version" );
+73      }
+74  
+75  }
+
+
+ Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/KeyValue.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/KeyValue.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/PropertiesIterator.html URL: http://svn.apache.org/viewvc/incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/PropertiesIterator.html?rev=1416291&view=auto ============================================================================== --- incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/PropertiesIterator.html (added) +++ incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/PropertiesIterator.html Sun Dec 2 23:31:59 2012 @@ -0,0 +1,124 @@ + + + + +PropertiesIterator xref + + + +
+
+1   package org.apache.onami.configuration.configuration;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one or more
+5    * contributor license agreements.  See the NOTICE file distributed with
+6    * this work for additional information regarding copyright ownership.
+7    * The ASF licenses this file to You under the Apache License, Version 2.0
+8    * (the "License"); you may not use this file except in compliance with
+9    * the License.  You may obtain a copy of the License at
+10   *
+11   *  http://www.apache.org/licenses/LICENSE-2.0
+12   *
+13   * Unless required by applicable law or agreed to in writing, software
+14   * distributed under the License is distributed on an "AS IS" BASIS,
+15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+16   * See the License for the specific language governing permissions and
+17   * limitations under the License.
+18   */
+19  
+20  import java.util.Iterator;
+21  import java.util.Map;
+22  import java.util.Map.Entry;
+23  
+24  
+25  /**
+26   * Simple iterator of a {@code Map<K, V>} entries, with the option of prefixing keys
+27   * with the given prefix.
+28   */
+29  final class PropertiesIterator<K, V>
+30      implements Iterator<Entry<String, String>>
+31  {
+32  
+33      /**
+34       * Creates a new iterator over a map configuration with prefixing the keys with the given prefix.
+35       *
+36       * @param <K> The map entry key type
+37       * @param <V> The map entry value type
+38       * @param properties The map configuration has to be read
+39       * @return A map configuration iterator
+40       */
+41      public static final <K, V> PropertiesIterator<K, V> newPropertiesIterator( Map<K, V> properties )
+42      {
+43          return new PropertiesIterator<K, V>( null, properties );
+44      }
+45  
+46      /**
+47       * Creates a new iterator over a map configuration with prefixing the keys with the given prefix.
+48       *
+49       * @param <K> the map entry key type.
+50       * @param <V> the map entry value type.
+51       * @param keyPrefix the prefix for key entries.
+52       * @param properties the map configuration has to be read.
+53       * @return a map configuration iterator.
+54       */
+55      public static final <K, V> PropertiesIterator<K, V> newPropertiesIterator( String keyPrefix, Map<K, V> properties )
+56      {
+57          return new PropertiesIterator<K, V>( keyPrefix, properties );
+58      }
+59  
+60      /**
+61       * The key prefix.
+62       */
+63      private final String keyPrefix;
+64  
+65      /**
+66       * The wrapped configuration iterator.
+67       */
+68      private final Iterator<Entry<K, V>> propertiesIterator;
+69  
+70      /**
+71       * Creates a new properties iterator.
+72       *
+73       * @param keyPrefix the key prefix. It can be {@code null}.
+74       * @param properties the wrapped configuration.
+75       */
+76      private PropertiesIterator( String keyPrefix, Map<K, V> properties )
+77      {
+78          this.keyPrefix = keyPrefix;
+79          this.propertiesIterator = properties.entrySet().iterator();
+80      }
+81  
+82      /**
+83       * {@inheritDoc}
+84       */
+85      public boolean hasNext()
+86      {
+87          return propertiesIterator.hasNext();
+88      }
+89  
+90      /**
+91       * {@inheritDoc}
+92       */
+93      public Entry<String, String> next()
+94      {
+95          Entry<K, V> next = propertiesIterator.next();
+96          String key = String.valueOf( next.getKey() );
+97          if ( keyPrefix != null && keyPrefix.length() > 0 )
+98          {
+99              key = keyPrefix + key;
+100         }
+101         return new KeyValue( key, String.valueOf( next.getValue() ) );
+102     }
+103 
+104     /**
+105      * {@inheritDoc}
+106      */
+107     public void remove() {
+108         // not needed in this version
+109     }
+110 
+111 }
+
+
+ Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/PropertiesIterator.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/onami/site/configuration/xref/org/apache/onami/configuration/configuration/PropertiesIterator.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision