Package java.util

Examples of java.util.Enumeration


     *            declarations.
     */   
    private void writeNSDecls ()
        throws SAXException
    {
        Enumeration prefixes = nsSupport.getDeclaredPrefixes();
        while (prefixes.hasMoreElements()) {
            String prefix = (String) prefixes.nextElement();
            String uri = nsSupport.getURI(prefix);
            if (uri == null) {
                uri = "";
            }
            char ch[] = uri.toCharArray();
View Full Code Here


     * This method is used on the root element to ensure that
     * the predeclared Namespaces all appear.
     */
    private void forceNSDecls ()
    {
        Enumeration prefixes = forcedDeclTable.keys();
        while (prefixes.hasMoreElements()) {
            String prefix = (String)prefixes.nextElement();
            doPrefix(prefix, null, true);
        }
    }
View Full Code Here

      Group group = (Group) iterator.next();
      // Signed group (empty group that contains a signature)?
      if (group instanceof JSigned) {
        continue;
      }
      Enumeration e = group.members();
      while (e.hasMoreElements()) {
        Principal p = (Principal) e.nextElement();
        principalRoles.add(p.getName());
      }
    }
    return principalRoles.toArray();
  }
View Full Code Here

            addAll = true;
        } else {
            searchStr = pattern.substring(0, globIndex);
        }

        Enumeration propNameEnum = props.propertyNames();
        while ( propNameEnum.hasMoreElements() ) {
            String name = (String) propNameEnum.nextElement();
            if ( name.startsWith(searchStr) || addAll ) {
                propNames.add(name);
            }
        }
View Full Code Here

            addAll = true;
        } else {
            searchStr = filterPattern.substring(0, globIndex);
        }

        Enumeration propNameEnum = props.propertyNames();
        while ( propNameEnum.hasMoreElements() ) {
            String name = (String) propNameEnum.nextElement();
            if ( name.startsWith(searchStr)) {
              Object value = props.get(name);
              if (value != null) {
                results.put(name.substring(searchStr.length()), value);
              }
View Full Code Here

     * object are added to the "addToThis" parameter.
     */
    public static void putAll(Properties addToThis,
                              Properties withThese) {
        if ( withThese != null && addToThis != null ) {
            Enumeration enumeration = withThese.propertyNames();
            while ( enumeration.hasMoreElements() ) {
                String propName = (String) enumeration.nextElement();
                Object propValue = withThese.get(propName);
                if ( propValue == null ) {
                    //defaults can only be retrieved as strings
                    propValue = withThese.getProperty(propName);
                }
View Full Code Here

            }
        }
    }
   
    public static void setOverrideProperies(Properties base, Properties override) {
        Enumeration overrideEnum = override.propertyNames();
        while (overrideEnum.hasMoreElements()) {
            String key = (String)overrideEnum.nextElement();
            String value = base.getProperty(key);
            String overRideValue = override.getProperty(key);
            if (value != null && !value.equals(overRideValue)) {
                base.setProperty(key, overRideValue);
            }
View Full Code Here

    }
   
    public static Properties sort(Properties props) {

        List names = new ArrayList();
        Enumeration enumeration = props.propertyNames();
        while ( enumeration.hasMoreElements() ) {
            String name = (String) enumeration.nextElement();
            names.add(name);
        }
        Collections.sort(names);

        Properties newProps = new Properties();
View Full Code Here

        stream = new FileOutputStream(fileName);
          writer = new PrintStream(stream);
   
            List names = new ArrayList();
            Enumeration enumeration = props.propertyNames();
            while ( enumeration.hasMoreElements() ) {
                String name = (String) enumeration.nextElement();
                names.add(name);
            }
            Collections.sort(names);
   
            StringBuffer sb;
View Full Code Here

    public static Collection sortPropertiesForPrinting(Properties props) {

        Collection sortedProps = new ArrayList(props.size());

        List names = new ArrayList();
        Enumeration enumeration = props.propertyNames();
        while ( enumeration.hasMoreElements() ) {
            String name = (String) enumeration.nextElement();
            names.add(name);
        }
        Collections.sort(names);

        StringBuffer sb;
View Full Code Here

TOP

Related Classes of java.util.Enumeration

Copyright © 2015 www.massapicom. 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.