Convert a collection to a string.

@param rootName Name of the XML root element
@param c Collection that needs to be marshalled
@return String representation of the collection
492890
public static <T> String marshal(String rootName, Collection<T> c) throws JAXBException {
    StringWriter sw = new StringWriter();
    marshal(rootName, c, sw);
    return sw.toString();
  }
592574
public String convertListToString(Object listOrString) {

		if (listOrString == null) {
			return null;
		}

		if (listOrString instanceof Collection) {
			List<String> list = (List<String>) listOrString;

			return StringUtils.join(list, ",");

		}

		return listOrString.toString();

	}
1311194
@Override
    protected String toStringInternal(final boolean useSimpleNames) {
        final StringBuilder buf = new StringBuilder();
        buf.append(
                useSimpleNames ? elementTypeSignature.toStringWithSimpleNames() : elementTypeSignature.toString());
        for (int i = 0; i < numDims; i++) {
            buf.append("[]");
        }
        return buf.toString();
    }
460713
public final String toFFDCString(Collection aCollection)
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append('{');
    if (aCollection == null)
    {
      buffer.append("<null>");
    }
    else
    {
      Iterator i = aCollection.iterator();
      boolean hasNext = i.hasNext();
      int ctr = 0;
      while (hasNext)
      {
        Object value = i.next();
        buffer.append((value == aCollection ? "<this list>" : toFFDCStringSingleObject(value)) + lineSeparator);

        hasNext = i.hasNext();
        if (ctr > multiple_object_count_to_ffdc)
        {
          buffer.append("........contd");
          hasNext = false;
        }
      }
    }

    buffer.append('}');

    return buffer.toString();
  }
1248915
public XMLString xstr()
  {
    int node = item(0);
    return (node != DTM.NULL) ? getStringFromNode(node) : XString.EMPTYSTRING;
  }
1176162
public static String getName(final Constructor<?> c) {
		StringBuilder ret = new StringBuilder("(");
		Class<?>[] parameterTypes = c.getParameterTypes();
		for (int i = 0; i < parameterTypes.length; i++) {
			if (i > 0)
				ret.append(',');
			ret.append(getName(parameterTypes[i]));
		}
		ret.append(')');
		return ret.toString();
	}
306075
public static String serialize(String xmlString) {
        StringWriter sw = new StringWriter();
        serialize(asStreamSource(xmlString), sw);
        return sw.toString();
    }
253346
public String getString(Collection<ByteBuffer> names)
    {
        StringBuilder builder = new StringBuilder();
        for (ByteBuffer name : names)
        {
            builder.append(getString(name)).append(",");
        }
        return builder.toString();
    }
566358
public static <T> List<T> getFieldValues(Iterable<?> collection, final String fieldName, final Class<T> elementType) {
		List<Object> fieldValues = getFieldValues(collection, fieldName);
		return Convert.toList(elementType, fieldValues);
	}
952474
private byte[] getRootItem(String rootName, String servlet) throws IOException
   {
      ByteArrayOutputStream outStream = new ByteArrayOutputStream();

      byte[] rootHead = getRootHeader();
      writeBytes(rootHead, outStream);

      byte[] rootValue = getRootValue(rootName);
      writeInt(rootValue.length / 2, outStream);
      writeBytes(rootValue, outStream);

      outStream.write(0);
      outStream.write(0);

      writeSizedString(servlet, outStream);

      writeZeroQWord(outStream);

      return outStream.toByteArray();
   }
89056
public static Element[] getChildren( Element root, String name )
    {
        if( null == root )
        {
            return new Element[0];
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        ArrayList<Element> result = new ArrayList<Element>();
        for( int i = 0; i < n; i++ )
        {
            Node item = list.item( i );
            if( item instanceof Element )
            {
                result.add( (Element) item );
            }
        }
        Element[] retval = new Element[result.size()];
        result.toArray( retval );
        return retval;
    }
1071302
public TreeElement findNode(String nodeName)
    {
        TreeElement root = getRoot(this);
        return root.findNodeRecurse(nodeName, nodeName);
    }
642298
public Tree setName(String name) {
		if (parent == null) {
			throw new UnsupportedOperationException("Root node has no name!");
		}
		if (!parent.isMap()) {
			throw new UnsupportedOperationException("Unable to set name (this node's parent is not a Map)!");
		}
		parent.remove((String) key);
		key = name;
		parent.putObjectInternal(name, value, false);
		return this;
	}
929828
public XMLElementList getChildrenByName(String name) {
		XMLElementList selected = new XMLElementList();
		XMLElementList children = getChildren();
		
		for (int i=0;i<children.size();i++) {
			if (children.get(i).getName().equals(name)) {
				selected.add(children.get(i));
			}
		}
		
		return selected;
	}
761950
public String xmlToThrift(String name) {
    name = name.replace("-custom.xml", "");
    name = name.replace(".xml", "");
    name = name.replace("-", "_");
    return name;
  }
1200717
public static String getText(final Node root) {
        if (root == null) {
            return "";
        } else {
            final StringBuilder result = new StringBuilder(1024);
            if (root.hasChildNodes()) {
                final NodeList list = root.getChildNodes();
                for (int i = 0; i < list.getLength(); i++) {
                    final Node childNode = list.item(i);
                    if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                        final Element e = (Element) childNode;
                        final String value = e.getAttribute(ATTRIBUTE_NAME_CLASS);
                        if (!excludeList.contains(value)) {
                            final String s = getText(e);
                            result.append(s);
                        }
                    } else if (childNode.getNodeType() == Node.TEXT_NODE) {
                        result.append(childNode.getNodeValue());
                    }
                }
            } else if (root.getNodeType() == Node.TEXT_NODE) {
                result.append(root.getNodeValue());
            }
            return result.toString();
        }
    }
1092979
public static String getName(Class<?> c) {
		if (c.isArray()) {
			StringBuilder sb = new StringBuilder();
			do {
				sb.append("[]");
				c = c.getComponentType();
			} while (c.isArray());

			return c.getName() + sb.toString();
		}
		return c.getName();
	}