Examples of OrderedProperties


Examples of flex2.compiler.util.OrderedProperties

  {
    if (in != null)
    {
      try
      {
        OrderedProperties p = new OrderedProperties();
        p.load(new BufferedReader(new InputStreamReader(in, encoding)));
        return p;
      }
      catch (IOException ex)
      {
        return null;
View Full Code Here

Examples of org.jetbrains.osgi.jps.util.OrderedProperties

   * @return the additional properties as a Map for convenience.
   */
  @NotNull
  public Map<String, String> getAdditionalPropertiesAsMap() {
    try {
      OrderedProperties p = new OrderedProperties();
      p.load(new StringReader(getAdditionalProperties()));
      return p.toMap();
    }
    catch (IOException e) {
      LOG.warn(e);
      return Collections.emptyMap();
    }
View Full Code Here

Examples of org.jetbrains.osgi.jps.util.OrderedProperties

* Test of {@link OrderedProperties}
*/
public class OrderedPropertiesTest {
  @Test
  public void testRead() throws IOException {
    OrderedProperties props = new OrderedProperties();
    props.load(new StringReader("Foo: Bar,\\\nnaf\nBar: naf\nBaz=naf\n"));

    Enumeration<Object> keys = props.keys();
    assertThat((String)keys.nextElement(), equalTo("Foo"));
    assertThat((String)keys.nextElement(), equalTo("Bar"));
    assertThat((String)keys.nextElement(), equalTo("Baz"));

    Enumeration<?> propertyNames = props.propertyNames();
    assertThat((String)propertyNames.nextElement(), equalTo("Foo"));
    assertThat((String)propertyNames.nextElement(), equalTo("Bar"));
    assertThat((String)propertyNames.nextElement(), equalTo("Baz"));

    Iterator<String> iterator = props.stringPropertyNames().iterator();
    assertThat(iterator.next(), equalTo("Foo"));
    assertThat(iterator.next(), equalTo("Bar"));
    assertThat(iterator.next(), equalTo("Baz"));
  }
View Full Code Here

Examples of org.jetbrains.osgi.jps.util.OrderedProperties

    assertThat(iterator.next(), equalTo("Baz"));
  }

  @Test
  public void testPopulate() throws Exception {
    OrderedProperties props = new OrderedProperties();
    props.setProperty("key1", "value1");
    props.setProperty("key3", "value3");
    props.setProperty("key2", "value2");

    Iterator<String> iterator = props.stringPropertyNames().iterator();
    assertThat(iterator.next(), equalTo("key1"));
    assertThat(iterator.next(), equalTo("key3"));
    assertThat(iterator.next(), equalTo("key2"));
  }
View Full Code Here

Examples of org.mule.util.OrderedProperties

            URL propertiesResource = allPropertiesResources.nextElement();
            if (logger.isDebugEnabled())
            {
                logger.debug("Reading bootstrap properties from: " + propertiesResource.toString());
            }
            Properties properties = new OrderedProperties();
            try
            {
                properties.load(propertiesResource.openStream());
            }
            catch (IOException e)
            {
                throw new BootstrapException(MessageFactory.createStaticMessage("Could not load properties from: %s", propertiesResource.toString()), e);
            }
View Full Code Here

Examples of org.mule.util.OrderedProperties

        }

        // Merge and process properties
        int objectCounter = 1;
        int transformerCounter = 1;
        Properties transformers = new OrderedProperties();
        Properties namedObjects = new OrderedProperties();
        Properties unnamedObjects = new OrderedProperties();
        Map<String,String> singleTransactionFactories = new LinkedHashMap<String,String>();

        for (Properties bootstrap : bootstraps)
        {
            for (Map.Entry entry : bootstrap.entrySet())
            {
                final String key = (String) entry.getKey();
                if (key.contains(OBJECT_KEY))
                {
                    String newKey = key.substring(0, key.lastIndexOf(".")) + objectCounter++;
                    unnamedObjects.put(newKey, entry.getValue());
                }
                else if (key.contains(TRANSFORMER_KEY))
                {
                    String newKey = key.substring(0, key.lastIndexOf(".")) + transformerCounter++;
                    transformers.put(newKey, entry.getValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.