@CopyMethod static Block upToBlock(EmptyDeclaration self) { return null; } }
@CopyMethod static boolean isInterface(AnnotationDeclaration self) { return true; } }
@CopyMethod static String getDescription(EmptyDeclaration self) { try { return ";"; } catch (Exception e) { return null; } }
@CopyMethod static boolean isInterface(AnnotationDeclaration self) { return true; } }
@CopyMethod static boolean isStatementExpressionsBased(For self) { return self.rawVariableDeclaration() == null; } }
@CopyMethod static boolean needsParentheses(Expression self) { try { return BinaryExpressionTemplate.needsParentheses(self, 1); } catch (Throwable ignore) { return true; } } }
@CopyMethod static boolean needsParentheses(Expression self) { try { return BinaryExpressionTemplate.needsParentheses(self, 1); } catch (Throwable ignore) { return true; } } }
@CopyMethod static boolean hasLabel(Break self) { return self.astLabel() != null; } }
@CopyMethod static boolean hasLabel(Continue self) { return self.astLabel() != null; } }
@CopyMethod static boolean needsParentheses(Expression self) { try { return BinaryExpressionTemplate.needsParentheses(self, 1); } catch (Throwable ignore) { return true; } } }
@CopyMethod static boolean isStatementExpressionsBased(For self) { return self.rawVariableDeclaration() == null; } }
@CopyMethod static boolean needsParentheses(Expression self) { try { return BinaryExpressionTemplate.needsParentheses(self, 1); } catch (Throwable ignore) { return true; } } }
@CopyMethod static boolean hasLabel(Continue self) { return self.astLabel() != null; } }
@CopyMethod static String getDescription(StringLiteral self) { String v = self.astValue(); if (v == null) return null; if (v.length() > 17) return v.substring(0, 8) + "\u2026" + v.substring(v.length() - 8); return v; }
@CopyMethod(isStatic=true) static List<KeywordModifier> fromReflectModifiers(int modifierFlags) { List<KeywordModifier> list = Lists.newArrayList(); for (Map.Entry<Integer, String> entry : REFLECT_MODIFIERS.inverse().entrySet()) { if ((modifierFlags & entry.getKey()) != 0) list.add(KeywordModifier.fromReflectModifier(entry.getKey())); } return list; }
@CopyMethod static boolean isMarkedDeprecated(Comment self) { return isJavadoc(self) && DEPRECATED_DETECTOR.matcher(self.astContent()).matches(); } }
@CopyMethod static String getTypeName(TypeReference self) { StringBuilder out = new StringBuilder(); for (TypeReferencePart p : self.astParts()) { if (out.length() > 0) out.append("."); out.append(p.getTypeName()); } for (int i = 0; i < self.astArrayDimensions(); i++) out.append("[]"); return out.toString(); }
@CopyMethod static String asFullyQualifiedName(ImportDeclaration self) { StringBuilder result = new StringBuilder(); for (Identifier part : self.astParts()) { if (result.length() != 0) result.append("."); result.append(part.astValue()); } if (self.astStarImport()) result.append(".*"); return result.toString(); } }
@CopyMethod static String getDescription(AnnotationElement self) { try { return self.astName().astValue(); } catch (NullPointerException e) { return null; } }
@CopyMethod static String getDescription(ConstructorInvocation self) { try { return self.astTypeReference().getDescription(); } catch (NullPointerException e) { return null; } } }