private void print(PropertyGet node) throws IOException { print(node.getLeft(), PRECEDENCE_MEMBER); writer.append('.'); Map<String, NameEmitter> oldNameMap = nameMap; nameMap = Collections.emptyMap(); print(node.getRight()); nameMap = oldNameMap; }
/** * Returns the object on which the property is being fetched. * Should never be {@code null}. */ public AstNode getTarget() { return getLeft(); }
/** * Returns the object on which the property is being fetched. * Should never be {@code null}. */ public AstNode getTarget() { return getLeft(); }
/** * Returns the object on which the property is being fetched. * Should never be {@code null}. */ public AstNode getTarget() { return getLeft(); }
/** * Returns the object on which the property is being fetched. * Should never be {@code null}. */ public AstNode getTarget() { return getLeft(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
@Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(getLeft().toSource(0)); sb.append("."); sb.append(getRight().toSource(0)); return sb.toString(); }
public static boolean isPrototypePropertyGet(PropertyGet pg) { return pg!=null && pg.getLeft() instanceof Name && isPrototypeNameNode(pg.getRight()); }
private void print(PropertyGet node) throws IOException { print(node.getLeft(), PRECEDENCE_MEMBER); writer.append('.'); Map<String, NameEmitter> oldNameMap = nameMap; nameMap = Collections.emptyMap(); print(node.getRight()); nameMap = oldNameMap; }
private boolean isJavaMethodRepository(AstNode node) { if (!(node instanceof PropertyGet)) { return false; } PropertyGet propertyGet = (PropertyGet) node; if (!(propertyGet.getLeft() instanceof Name)) { return false; } if (!((Name) propertyGet.getTarget()).getIdentifier().equals("javaMethods")) { return false; } return propertyGet.getProperty().getIdentifier().equals("get"); } }
/** * Returns whether a <code>PropertyGet</code> is a simple one, referencing * an object's value 1 level deep. For example, <code>Object.create</code>. * * @param pg The <code>PropertyGet</code>. * @param expectedObj The expected object value. * @param expectedField The expected string value. * @return Whether the object is what was expected. */ public static boolean isSimplePropertyGet(PropertyGet pg, String expectedObj, String expectedField) { return pg!=null && isName(pg.getLeft(), expectedObj) && isName(pg.getRight(), expectedField); }