Example usage for org.eclipse.jdt.core.dom StringLiteral toString

List of usage examples for org.eclipse.jdt.core.dom StringLiteral toString

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom StringLiteral toString.

Prototype

@Override
public final String toString() 

Source Link

Document

Returns a string representation of this node suitable for debugging purposes only.

Usage

From source file:org.ebayopensource.dsf.javatojs.translate.LiteralTranslator.java

License:Open Source License

SimpleLiteral toJstLiteral(final StringLiteral literal) {
    String s = literal.toString();
    return SimpleLiteral.getStringLiteral(s.substring(1, s.length() - 1));
    //return new SimpleLiteral(String.class, JstReservedTypes.JsNative.STRING, s.substring(1, s.length()-1));
}

From source file:org.eclipse.swordfish.tooling.test.util.project.SFASTMatcher.java

License:Open Source License

/**
 * Additional behavior: for file URLs always true is returned
 * /*from  w w w.j a v  a 2  s.  c  o  m*/
 * Returns whether the given node and the other object match.
 * <p>
 * The default implementation provided by this class tests whether the
 * other object is a node of the same type with structurally isomorphic
 * child subtrees. Subclasses may override this method as needed.
 * </p>
 *
 * @param node the node
 * @param other the other object, or <code>null</code>
 * @return <code>true</code> if the subtree matches, or
 *   <code>false</code> if they do not match or the other object has a
 *   different node type or is <code>null</code>
 */
synchronized public boolean match(StringLiteral node, Object other) {
    if (!(other instanceof StringLiteral)) {
        return false;
    }
    StringLiteral o = (StringLiteral) other;
    if (node.toString().indexOf(EXCLUDE_FILEURL) >= 0 && o.toString().indexOf(EXCLUDE_FILEURL) >= 0)
        return true;
    return super.match(node, other);
}

From source file:org.jboss.windup.decorator.java.JavaASTAnnotationVisitor.java

License:Open Source License

protected String extract(StringLiteral value) {
    String val = value.toString();
    val = StringUtils.removeStart(val, "\"");
    val = StringUtils.removeEnd(val, "\"");

    return val;
}