Package java.util

Examples of java.util.Dictionary.keys()


        ReifiedType keyType = type.getActualTypeArgument(0);
        ReifiedType valueType = type.getActualTypeArgument(1);
        Map newMap = (Map) getMap(toClass(type)).newInstance();
        if (obj instanceof Dictionary) {
            Dictionary dic = (Dictionary) obj;
            for (Enumeration keyEnum = dic.keys(); keyEnum.hasMoreElements();) {
                Object key = keyEnum.nextElement();
                try {
                    newMap.put(convert(key, keyType), convert(dic.get(key), valueType));
                } catch (Exception t) {
                    throw new Exception("Unable to convert from " + obj + " to " + type + "(error converting map entry)", t);
View Full Code Here


        try {
            Configuration configuration = configurationAdmin.getConfiguration("org.ops4j.pax.logging");

            // get the ".file" Pax Logging properties
            Dictionary dictionary = configuration.getProperties();
            for (Enumeration e = dictionary.keys(); e.hasMoreElements(); ) {
                String property = (String) e.nextElement();
                if (property.endsWith(".file")) {
                    // it's a file appender, get the file location
                    String location = (String) dictionary.get(property);
                    File file = new File(location);
View Full Code Here

                System.out.println("BundleLocation: " + config.getBundleLocation());
                if (config.getProperties() != null) {
                    System.out.println("Properties:");
                    Dictionary props = config.getProperties();
                    Map<String, Object> sortedProps = new TreeMap<String, Object>();
                    for (Enumeration e = props.keys(); e.hasMoreElements();) {
                        Object key = e.nextElement();
                        sortedProps.put(key.toString(), props.get(key));
                    }
                    for (String key : sortedProps.keySet()) {
                        System.out.println("   " + key + " = " + sortedProps.get(key));
View Full Code Here

    private void listHeaders( JSONWriter jw, Bundle bundle ) throws JSONException
    {
        JSONArray val = new JSONArray();

        Dictionary headers = bundle.getHeaders(""); // don't localize at all - raw headers
        Enumeration he = headers.keys();
        while ( he.hasMoreElements() )
        {
            Object header = he.nextElement();
            String value = String.valueOf(headers.get( header ));
            // Package headers may be long, support line breaking by
View Full Code Here

                "This form is automatically generated from existing properties because no property "
                    + "descriptors are available for this configuration. This may be cause by the absence "
                    + "of the OSGi Metatype Service or the absence of a MetaType descriptor for this configuration." );

            json.key( "properties" ).object(); //$NON-NLS-1$
            for ( Enumeration pe = props.keys(); pe.hasMoreElements(); )
            {
                final String id = ( String ) pe.nextElement();

                // ignore well known special properties
                if ( !id.equals( Constants.SERVICE_PID ) && !id.equals( Constants.SERVICE_DESCRIPTION )
View Full Code Here

        try {
            Configuration configuration = configurationAdmin.getConfiguration("org.ops4j.pax.logging");

            // get the ".file" Pax Logging Properties
            Dictionary dictionary = configuration.getProperties();
            for (Enumeration e = dictionary.keys(); e.hasMoreElements(); ) {
                String property = (String) e.nextElement();
                if (property.endsWith(".file")) {
                    // it's a file appender, get the log file location
                    String location = (String) dictionary.get(property);
                    File file = new File(location);
View Full Code Here

  }

  // Append the required query parameters
  StringBuffer sb = new StringBuffer(href);
  boolean question = (href.indexOf("?") >= 0);
  Enumeration keys = dictionary.keys();
  while (keys.hasMoreElements()) {
      String key = (String) keys.nextElement();
      Object value = dictionary.get(key);
      if (value instanceof String[]) {
    String values[] = (String[]) value;
View Full Code Here

  }

  // Append the required query parameters
  StringBuffer sb = new StringBuffer(href);
  boolean question = (href.indexOf("?") >= 0);
  Enumeration keys = dictionary.keys();
  while (keys.hasMoreElements()) {
      String key = (String) keys.nextElement();
      Object value = dictionary.get(key);
      if (value instanceof String[]) {
    String values[] = (String[]) value;
View Full Code Here

  }

  // Append the required query parameters
  StringBuffer sb = new StringBuffer(href);
  boolean question = (href.indexOf("?") >= 0);
  Enumeration keys = dictionary.keys();
  while (keys.hasMoreElements()) {
      String key = (String) keys.nextElement();
      Object value = dictionary.get(key);
      if (value instanceof String[]) {
    String values[] = (String[]) value;
View Full Code Here

  }

  // Append the required query parameters
  StringBuffer sb = new StringBuffer(href);
  boolean question = (href.indexOf("?") >= 0);
  Enumeration keys = dictionary.keys();
  while (keys.hasMoreElements()) {
      String key = (String) keys.nextElement();
      Object value = dictionary.get(key);
      if (value instanceof String[]) {
    String values[] = (String[]) 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.