CollectionHelper.java revision c44bbf5d2025d672efe11a37ea6e9c867e78b691
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster/**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * The contents of this file are subject to the terms
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * of the Common Development and Distribution License
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * (the License). You may not use this file except in
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * compliance with the License.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * You can obtain a copy of the License at
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * opensso/legal/CDDLv1.0.txt
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * See the License for the specific language governing
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * permission and limitations under the License.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * When distributing Covered Code, include this CDDL
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Header Notice in each file and include the License file
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * at opensso/legal/CDDLv1.0.txt.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * If applicable, add the following below the CDDL Header,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * with the fields enclosed by brackets [] replaced by
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * your own identifying information:
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * $Id: CollectionHelper.java,v 1.6 2010/01/06 22:31:55 veiming Exp $
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster/*
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott * Portions Copyrighted 2010-2014 ForgeRock AS
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterpackage com.sun.identity.shared.datastruct;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport com.sun.identity.shared.debug.Debug;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport com.sun.identity.shared.configuration.SystemPropertiesManager;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport java.util.Iterator;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport java.util.Map;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport java.util.Set;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport com.sun.identity.shared.Constants;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport java.util.LinkedHashSet;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster/**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * This class contains various Collection manipulation methods.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterpublic class CollectionHelper {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster private static final String localDsameServer = SystemPropertiesManager.get(
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Constants.AM_SERVER_HOST);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster /**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Returns String from a map of string of set of string.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param map Map of string of set of string.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param name Key of the map entry.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @return String from a map of string of set of string
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster public static String getMapAttr(Map map, String name) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Set s = (Set)map.get(name);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String retVal = ((s == null) || s.isEmpty()) ? null :
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ((String)s.iterator().next());
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return (retVal != null) ? retVal.trim() : null;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster /**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Returns String from a map of string of set of string.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param map Map of string of set of string.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param name Key of the map entry.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param defaultValue Default value if the string is not found.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @return String from a map of string of set of string
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster public static String getMapAttr(Map map, String name, String defaultValue) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String str = getMapAttr(map, name);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return ((str != null) && (str.length() > 0)) ? str : defaultValue;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott /**
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott * Gets a boolean attribute from a {@code Map<String, Set<String>>}, defaulting to the given default value if
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott * the attribute is not present.
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott *
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott * @param map the attribute map.
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott * @param name the name of the attribute to retrieve.
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott * @param defaultValue the value to use if the attribute is not present.
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott * @return the boolean value using {@link Boolean#parseBoolean(String)}.
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott */
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott public static boolean getBooleanMapAttr(Map map, String name, boolean defaultValue) {
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott String value = getMapAttr(map, name, Boolean.toString(defaultValue));
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott return Boolean.parseBoolean(value);
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott }
2210fc30709625f254e6a6d5dc89c3bfefa48816Robert Wapshott
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster /**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Returns integer value from a Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param map Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param name Kye of the map entry.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param defaultValue Default value if the integer value is not found.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param debug Debug object.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @return integer value from a Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster public static int getIntMapAttr(
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Map map,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String name,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String defaultValue,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Debug debug
f5d3a8b100ee0ed5cb341715566899484736d71cPeter Major ) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster try {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return Integer.parseInt(getMapAttr(map, name, defaultValue));
f5d3a8b100ee0ed5cb341715566899484736d71cPeter Major } catch (NumberFormatException nfe) {
f5d3a8b100ee0ed5cb341715566899484736d71cPeter Major debug.error("CollectionHelper.getIntMapAttr", nfe);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return Integer.parseInt(defaultValue);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster /**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Returns integer value from a Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param map Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param name Key of the map entry.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param defaultValue Default value if the integer value is not found.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param debug Debug object.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @return integer value from a Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster public static int getIntMapAttr(
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Map map,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String name,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster int defaultValue,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Debug debug
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster try {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return Integer.parseInt(getMapAttr(map, name));
f5d3a8b100ee0ed5cb341715566899484736d71cPeter Major } catch (NumberFormatException nfe) {
f5d3a8b100ee0ed5cb341715566899484736d71cPeter Major debug.error("CollectionHelper.getIntMapAttr", nfe);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return defaultValue;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden /**
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden * Returns a long value from the given configuration map.
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden *
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden * @param config the map of attribute values.
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden * @param name the attribute name to get.
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden * @param defaultValue the default value to use if the attribute is not set or is not a long.
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden * @param debug the debug object to report format errors to.
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden * @return the long value of the attribute or the defaultValue if not set/not a long.
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden */
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden public static long getLongMapAttr(Map<String, Set<String>> config, String name, long defaultValue, Debug debug) {
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden try {
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden return Long.parseLong(getMapAttr(config, name));
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden } catch (NumberFormatException nfe) {
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden debug.error("CollectionHelper.getLongMapAttr", nfe);
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden return defaultValue;
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden }
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden }
c44bbf5d2025d672efe11a37ea6e9c867e78b691Neil Madden
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster /**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * This convenience method is for getting server specific attributes from a
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * list attribute. Server specific is determined by prefixing a list
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * attribute value with DSAME local server name followed by the | character.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * If the list has more than one entry but no matching local server prefixes
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * than null is returned as this is an invalid configuration for these type
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * of attributes. This allows services like authentication to support a
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * geographic directory configuration.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param map Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param attrName Key of the map entry of interest.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @return the server name.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster public static String getServerMapAttr(Map map, String attrName) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String result = null;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Set attrValues = (Set)map.get(attrName);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (attrValues.size() == 1) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Iterator iter = attrValues.iterator();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String strServer = (String)iter.next();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (strServer != null) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster strServer = strServer.trim();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return strServer;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if ((attrValues != null) && !attrValues.isEmpty()) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster for (Iterator i = attrValues.iterator();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster i.hasNext() && (result == null);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster result = (String)i.next();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (result != null) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster result = result.trim();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (result.startsWith(localDsameServer)) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster int index = result.indexOf("|");
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (index != -1) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster result = result.substring(index + 1);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster } else {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster result = null;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster } else {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster result = null;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return result;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster /**
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * This convenience method is for getting server specific attributes from a
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * list attribute. Server specific is determined by prefixing a list
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * attribute value with DSAME local server name followed by the | character.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * If the list has more than one entry but no matching local server prefixes
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * than an empty Set is returned as this is an invalid configuration for
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * these type of attributes. This allows services like authentication to
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * support a geographic directory configuration.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster *
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param map Map of String of Set of String.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param attrName Key of the map entry of interest.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @return attributes belonging to this server, or if there is only one
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * attribute, then that
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster */
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster public static Set<String> getServerMapAttrs(Map<String, Set<?>> map, String attrName) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Set<String> ret = new LinkedHashSet<String>();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Set<String> attrValues = (Set<String>) map.get(attrName);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (attrValues.size() == 1) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Iterator<String> iter = attrValues.iterator();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String strServer = iter.next();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (strServer != null) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster strServer = strServer.trim();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ret.add(strServer);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return ret;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster for (String attr : attrValues) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (attr != null) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster attr = attr.trim();
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (attr.startsWith(localDsameServer)) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster int index = attr.indexOf("|");
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster if (index != -1) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster attr = attr.substring(index + 1);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ret.add(attr);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster return ret;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster}