Package java.util

Examples of java.util.Properties.propertyNames()


   * Get the extra properties passed to each sql connection
   */

  String pre = props.getProperty(hr.prefix + "sqlPrefix");
  if (pre != null) {
      Enumeration enumer = props.propertyNames();
      int len= pre.length();
      sqlProps = new Properties();
      while(enumer.hasMoreElements()) {
    String key = (String) enumer.nextElement();
    if (key.startsWith(pre)) {
View Full Code Here


      String name = (String) query.get("name");
      String value = (String) query.get("value");
      Properties props = request.props;
      if (name == null) {
    StringBuffer sb = new StringBuffer();
    Enumeration e = props.propertyNames();
    while (e.hasMoreElements()) {
        String key = (String) e.nextElement();
        sb.append(key).append("=");
        sb.append(getProp(props, key));
        sb.append("\n");
View Full Code Here

      /*
       * Copy the properties into the server.
       */

      if (prepend != null && sessionTable == null) {
    Enumeration enumer = props.propertyNames();
    while(enumer.hasMoreElements()) {
        String key = (String) enumer.nextElement();
        server.props.put(prepend + key, props.getProperty(key));
    }
      }
View Full Code Here

  private void setDefaults(Properties props, String method)
  {
    final Properties method_props =
      OutputPropertiesFactory.getDefaultMethodProperties(method);
    {
      final Enumeration names = method_props.propertyNames();
      while (names.hasMoreElements())
      {
        final String name = (String)names.nextElement();
        props.setProperty(name, method_props.getProperty(name));
      }
View Full Code Here

    /**
     * @tests java.util.Properties#propertyNames()
     */
    public void test_propertyNames() {
        Properties myPro = new Properties(tProps);
        Enumeration names = myPro.propertyNames();
        while (names.hasMoreElements()) {
            String p = (String) names.nextElement();
            assertTrue("Incorrect names returned", p.equals("test.prop")
                    || p.equals("bogus.prop"));
        }
View Full Code Here

    public void test_propertyNames_sequence() {
        Properties parent = new Properties();
        parent.setProperty("parent.a.key", "parent.a.value");
        parent.setProperty("parent.b.key", "parent.b.value");

        Enumeration<?> names = parent.propertyNames();
        assertEquals("parent.a.key", names.nextElement());
        assertEquals("parent.b.key", names.nextElement());
        assertFalse(names.hasMoreElements());

        Properties current = new Properties(parent);
View Full Code Here

        Properties current = new Properties(parent);
        current.setProperty("current.a.key", "current.a.value");
        current.setProperty("current.b.key", "current.b.value");

        names = current.propertyNames();
        assertEquals("parent.a.key", names.nextElement());
        assertEquals("current.b.key", names.nextElement());
        assertEquals("parent.b.key", names.nextElement());
        assertEquals("current.a.key", names.nextElement());
        assertFalse(names.hasMoreElements());
View Full Code Here

        Properties child = new Properties(current);
        child.setProperty("child.a.key", "child.a.value");
        child.setProperty("child.b.key", "child.b.value");

        names = child.propertyNames();
        assertEquals("parent.a.key", names.nextElement());
        assertEquals("child.b.key", names.nextElement());
        assertEquals("current.b.key", names.nextElement());
        assertEquals("parent.b.key", names.nextElement());
        assertEquals("child.a.key", names.nextElement());
View Full Code Here

          .addQuotedAttribute( "strategy", strategy);

        List params = new ArrayList();
        //wholeString.append( "parameters = {  " );
        if ( properties != null ) {
          Enumeration propNames = properties.propertyNames();
          while ( propNames.hasMoreElements() ) {

            String propertyName = (String) propNames.nextElement();
            AnnotationBuilder parameter = AnnotationBuilder.createAnnotation( importType("org.hibernate.annotations.Parameter") )
                  .addQuotedAttribute( "name", propertyName )
View Full Code Here

        }
        for (Map.Entry<String, String> ent : endpoint.getJndiParameters().entrySet()) {
            env.put(ent.getKey(), ent.getValue());
        }
        if (LOG.isLoggable(Level.FINE)) {
            Enumeration props = env.propertyNames();
            while (props.hasMoreElements()) {
                String name = (String)props.nextElement();
                String value = env.getProperty(name);
                LOG.log(Level.FINE, "Context property: " + name + " | " + value);
            }
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.