Creates a String representation of a variable element with everything
necessary to track all public aspects of it in an API.
@param e Element to create String for.
@return String representation of element.
15063
protected String makeVariableString(VariableElement e) {
        StringBuilder result = new StringBuilder();
        for (Modifier modifier : e.getModifiers()) {
            result.append(modifier.toString());
            result.append(" ");
        }
        result.append(e.asType().toString());
        result.append(" ");
        result.append(e.toString());
        Object value = e.getConstantValue();
        if (value != null) {
            result.append(" = ");
            if (e.asType().toString().equals("char")) {
                int v = (int)value.toString().charAt(0);
                result.append("'\\u"+Integer.toString(v,16)+"'");
            } else {
                result.append(value.toString());
            }
        }
        return result.toString();
    }
33849
static String getDeepName(final Element element) {
        if (element == null) {
            return "";
        }
        return getDeepName(element.getParentElement()) + '/' + element.getName();
    }
242718
public static Map<String, String> retrieveContextParam(Element element) {
        Map<String, String> contextParams = new HashMap<String, String>();
        NodeList elementsByTagName = element.getElementsByTagNameNS("*", "context-param");
        for (int i = 0; i < elementsByTagName.getLength(); i++) {
            Element subElement = (Element) elementsByTagName.item(i);
            contextParams.put(retrieveNodeValude(subElement, "param-name"),
                retrieveNodeValude(subElement, "param-value"));
        }
        return contextParams;
    }
238765
public String thisToString()
    {
        return "{JPAExPcBindingContext: BindId=" + ivBindId +
               ", BMT=" + (ivIsBmt ? 'T' : 'F') + ", UserTxBegun=" +
               (ivHasBmtUserTxBegunInMethod ? 'T' : 'F') + ", Name=" + ivJ2eeName +
               ", PuIds=<" + ivPuIds.length + "> " + Arrays.toString(ivPuIds) + '}';
    }
1214383
String signature(ExecutableElement e) {
        StringBuilder sb = new StringBuilder("(");
        String sep = "";
        for (VariableElement p: e.getParameters()) {
            sb.append(sep);
            sb.append(types.erasure(p.asType()).toString());
            sep = ",";
        }
        sb.append(")");
        return sb.toString();
    }
1352038
public static String toBinaryString(final byte[] data) {
        if (data == null) {
            return null;
        }
        final StringBuilder buf = new StringBuilder(data.length * 8);
        for (final byte element : data) {
            byte bits = element;
            for (int j = 0; j < 8; j++) {
                if ((bits & 0x80) == 0x80) {
                    buf.append('1');
                } else {
                    buf.append('0');
                }
                bits <<= 1;
            }
        }
        return buf.toString();
    }
592340
private void createElement(XsdElement element, String apiName) {
        String elementName = element.getName();

        if (!createdElements.containsKey(getCleanName(elementName))){
            createdElements.put(getCleanName(elementName), element);
            xsdAsmInstance.generateClassFromElement(element, apiName);
        }
    }
379590
@Override
	public void log(Exception e, Object... elements) {
		StringBuilder sb = buildMsg(Level.ERROR, elements);
		context.log(sb.toString(),e);
	}
928617
public String getString(String name)
    {
        List part = _partMap.getValues(name);
        if (part==null)
            return null;
        if (_encoding != null)
        {
            try 
            {
                return new String(((Part)part.get(0))._data, _encoding);
            } 
            catch (UnsupportedEncodingException uee) 
            {
                if (log.isDebugEnabled())log.debug("Invalid character set: " + uee);
                return null;
            }
        }
        else
            return new String(((Part)part.get(0))._data);
    }
1285367
public static Element createParam (String name, String value)
    {
        Element pelem = DOM.createElement("param");
        DOM.setElementProperty(pelem, "name", name);
        DOM.setElementProperty(pelem, "value", value);
        return pelem;
    }
698434
static final String path(Element element) {
        StringBuilder sb = new StringBuilder();

        Node iterator = element;
        while (iterator.getNodeType() == Node.ELEMENT_NODE) {
            sb.insert(0, $(iterator).tag());
            sb.insert(0, "/");

            iterator = iterator.getParentNode();
        }

        return sb.toString();
    }
143930
@Override
  public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)
  {
    // since we return a constant, no need to read from the event
  }
105442
protected static EncodedElement getEnd_S(EncodedElement e) {
    if(e == null)
      return null;
    EncodedElement temp = e.next;
    EncodedElement end = e;
    while(temp != null) {
      end = temp;
      temp = temp.next;
    }
    return end;
  }
1035264
public String stringify() {
        if (type == TokenType.TEXT) {
            return defaultValue;
        }
        StringBuilder sb = new StringBuilder();
        if (type == TokenType.BEAN) {
            sb.append(BEAN_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
            if (value != null) {
                sb.append(VALUE_SEPARATOR);
                sb.append(value);
            }
            if (getterName != null) {
                sb.append(GETTER_SEPARATOR);
                sb.append(getterName);
            }
        } else if (type == TokenType.TEMPLATE) {
            sb.append(TEMPLATE_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
        } else if (type == TokenType.PARAMETER) {
            sb.append(PARAMETER_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
        } else if (type == TokenType.ATTRIBUTE) {
            sb.append(ATTRIBUTE_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
            if (getterName != null) {
                sb.append(GETTER_SEPARATOR);
                sb.append(getterName);
            }
        } else if (type == TokenType.PROPERTY) {
            sb.append(PROPERTY_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
            if (value != null) {
                sb.append(VALUE_SEPARATOR);
                sb.append(value);
            }
            if (getterName != null) {
                sb.append(GETTER_SEPARATOR);
                sb.append(getterName);
            }
        } else {
            throw new InvalidTokenException("Unknown token type: " + type, this);
        }
        if (defaultValue != null) {
            sb.append(VALUE_SEPARATOR);
            sb.append(defaultValue);
        }
        sb.append(END_BRACKET);
        return sb.toString();
    }
571301
public static String exception2StringShort(Exception e) {
        StringBuffer st = new StringBuffer();
        Throwable e2 = e;

        while (e2 != null) {
            String exClass = e2.getClass().getName();
            String msg = e2.getMessage();

            if (msg != null) {
                st.setLength(0);
                st.append(exClass);
                st.append(": ");
                st.append(msg);
            }
            e2 = e2.getCause();
        }

        return st.toString().trim();
    }
35357
public static String stackToDebugString(Throwable e) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        e.printStackTrace(pw);
        pw.close();
        String text = sw.toString();
        
        // Jump past the throwable
        text = text.substring(text.indexOf("at"));
        return text;
    }
930605
private static void createElement(String apiName) {
        ClassWriter classWriter = generateClass(ELEMENT, JAVA_OBJECT, null, "<T::" + elementTypeDesc + "Z::" + elementTypeDesc + ">" + JAVA_OBJECT_DESC, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, apiName);

        MethodVisitor mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "self", "()" + elementTypeDesc, "()TT;", null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "getVisitor", "()" + elementVisitorTypeDesc, null, null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "getName", "()" + JAVA_STRING_DESC, null, null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "__", "()" + elementTypeDesc, "()TZ;", null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "getParent", "()" + elementTypeDesc, "()TZ;", null);
        mVisitor.visitEnd();

        writeClassToFile(ELEMENT, classWriter, apiName);
    }