Package java.util

Examples of java.util.Dictionary.keys()


    {
  Properties props = hr.request.props;
  String query = props.getProperty(hr.prefix + "query");
  if (query != null) {
      Dictionary h = hr.request.getQueryData(null);
      Enumeration keys = h.keys();
      while(keys.hasMoreElements()) {
    String key = (String) keys.nextElement();
    props.put(query + key, h.get(key));
      }
  }
View Full Code Here


            Dictionary props = component.getProperties();
            if ( props != null )
            {
                out.println( "Properties:" );
                TreeSet keys = new TreeSet( Collections.list( props.keys() ) );
                for ( Iterator ki = keys.iterator(); ki.hasNext(); )
                {
                    Object key = ki.next();
                    out.print( "    " );
                    out.print( key );
View Full Code Here

        Dictionary out = action.invoke(inputArgs);

        // prepare output arguments
        if (out != null && out.size() > 0)
        {
            for (Enumeration e = out.keys(); e.hasMoreElements();)
            {
                String key = (String) e.nextElement();
                UPnPStateVariable var = action.getStateVariable(key);

                Object value = out.get(key);
View Full Code Here

        ReifiedType keyType = type.getActualTypeArgument(0);
        ReifiedType valueType = type.getActualTypeArgument(1);
        Dictionary newDic = new Hashtable();
        if (obj instanceof Dictionary) {
            Dictionary dic = (Dictionary) obj;
            for (Enumeration keyEnum = dic.keys(); keyEnum.hasMoreElements();) {
                Object key = keyEnum.nextElement();
                try {
                    newDic.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

        ReifiedType valueType = type.getActualTypeArgument(1);
        Map newMap = (Map) ReflectionUtils.newInstance(blueprintContainer.getAccessControlContext(),
                                                       MapRecipe.getMap(toClass(type)));
        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

                props.setProperty(ResourceHandler.PATH, resource.getPath());
                props.setProperty(ResourceHandler.PROTOCOL, resource.getProtocol());
                props.setProperty(ResourceHandler.PORT, Integer.toString(resource.getPort()));
                // add the custom resource properties
                if (resourceProperties != null) {
                  Enumeration properyKeysEnum = resourceProperties.keys();
                  while (properyKeysEnum.hasMoreElements()) {
                    String key = (String) properyKeysEnum.nextElement();
                    if (!key.equals(ResourceHandler.HOST) &&
                        !key.equals(ResourceHandler.PATH) &&
                        !key.equals(ResourceHandler.PROTOCOL) &&
View Full Code Here

        m_ensure.step(3);
       
        Properties newProps = new Properties();
        // update the component's service properties
        Dictionary dict = component.getServiceProperties();
        Enumeration e = dict.keys();
        while (e.hasMoreElements()) {
          String key = (String) e.nextElement();
          String value = (String) dict.get(key);
          newProps.setProperty(key, value);
        }
View Full Code Here

   
    private void appendProperties(StringBuffer result) {
        Dictionary properties = calculateServiceProperties();
        if (properties != null) {
            result.append("(");
            Enumeration enumeration = properties.keys();
            while (enumeration.hasMoreElements()) {
                Object key = enumeration.nextElement();
                result.append(key.toString());
                result.append('=');
                Object value = properties.get(key);
View Full Code Here

        ReifiedType keyType = type.getActualTypeArgument(0);
        ReifiedType valueType = type.getActualTypeArgument(1);
        Dictionary newDic = new Hashtable();
        if (obj instanceof Dictionary) {
            Dictionary dic = (Dictionary) obj;
            for (Enumeration keyEnum = dic.keys(); keyEnum.hasMoreElements();) {
                Object key = keyEnum.nextElement();
                try {
                    newDic.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

        ReifiedType valueType = type.getActualTypeArgument(1);
        Map newMap = (Map) ReflectionUtils.newInstance(blueprintContainer.getAccessControlContext(),
                                                       MapRecipe.getMap(toClass(type)));
        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

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.