| java.lang.Object javaparser.Utils
Utils | final public class Utils (Code) | | Mainly tree utils.
|
Method Summary | |
static void | collectChilds(ParserTreeNode tn, List<Token> tokens) depth first. | public static int | compareModifiers(int[] m1, int[] m2) Can be used to compare accorting ordering {public, pscope, protected, private}
pscope araises when no other modifier (pub, pri, pro) are declared. | public static void | getAllFields(ParserTreeNode node, List<FieldNode> found) | public static void | getAllMethods(ParserTreeNode node, List<MethodNode> found) | public static String | getFileContent(File f) | static Token | getFirstSubchild(ParserTreeNode tn) depth first. | static Token | getFirstToken_ONLYInDirectChilds(ParserTreeNode tn, int kind) null if none, null if tn is null. | static String | getImageOfAllSubElements(ParserTreeNode tn) | static Token | getLastSubchild(ParserTreeNode tn) depth first. | public static Element | getLine(Document doc, int line) | public static int | getLineNumber(Document doc, int offset) | static String | getModifiersShortString(int[] mods) if any mod found, a space after is present
Annotations are ignored
static String getModifiers(ParserTreeNode mods)
{
if(mods==null) return ""; // ERROR
if(mods.getChildCount()==0) return "";
StringBuilder mod = new StringBuilder();
for(int i=0; i | public static String | getModifiersWithoutAccessModifiersFullString(int[] mods) | public static int | getOrderForSort(int[] mods) Can be used to compare accorting ordering {1=public, 2=pscope, 3=protected, 4=private}
pscope araises when no other modifier (pub, pri, pro) are declared. | public static boolean | isAccessModifier(int mod) | public static boolean | isInto(int line, int col, Token from, Token to) | public static boolean | isPrivate(int[] mods) looks if JavaParserConstants.PRIVATE is present. | public static boolean | isProtected(int[] mods) looks if JavaParserConstants.PROTECTED is present. | public static boolean | isPublic(int[] mods) looks if JavaParserConstants.PUBLIC is present. | public static boolean | isStatic(int[] mods) looks if JavaParserConstants.PUBLIC is present. | public static void | makeChildsExpanded(ParserTreeNode node, JTree tree, int numberOfLevels) makes the given number of levels childs expanded. | public static void | sortedInsert(ParserTreeNode node, ParserTreeNode destination) Used for fields and methods and constructors. | public static String | toStringWithoutBraces(List> v) Simple helper. |
compareModifiers | public static int compareModifiers(int[] m1, int[] m2)(Code) | | Can be used to compare accorting ordering {public, pscope, protected, private}
pscope araises when no other modifier (pub, pri, pro) are declared.
|
getAllFields | public static void getAllFields(ParserTreeNode node, List<FieldNode> found)(Code) | | Parameters: node - pass the public, private of package scope or protected node as argument. |
getAllMethods | public static void getAllMethods(ParserTreeNode node, List<MethodNode> found)(Code) | | Parameters: node - pass the public, private of package scope or protected node as argument. |
getFirstToken_ONLYInDirectChilds | static Token getFirstToken_ONLYInDirectChilds(ParserTreeNode tn, int kind)(Code) | | null if none, null if tn is null. used
|
getLineNumber | public static int getLineNumber(Document doc, int offset)(Code) | | |
getModifiersShortString | static String getModifiersShortString(int[] mods)(Code) | | if any mod found, a space after is present
Annotations are ignored
static String getModifiers(ParserTreeNode mods)
{
if(mods==null) return ""; // ERROR
if(mods.getChildCount()==0) return "";
StringBuilder mod = new StringBuilder();
for(int i=0; i |
getModifiersWithoutAccessModifiersFullString | public static String getModifiersWithoutAccessModifiersFullString(int[] mods)(Code) | | |
getOrderForSort | public static int getOrderForSort(int[] mods)(Code) | | Can be used to compare accorting ordering {1=public, 2=pscope, 3=protected, 4=private}
pscope araises when no other modifier (pub, pri, pro) are declared.
|
isAccessModifier | public static boolean isAccessModifier(int mod)(Code) | | |
isInto | public static boolean isInto(int line, int col, Token from, Token to)(Code) | | Parameters: line - 1 for the first |
isPrivate | public static boolean isPrivate(int[] mods)(Code) | | looks if JavaParserConstants.PRIVATE is present.
|
isProtected | public static boolean isProtected(int[] mods)(Code) | | looks if JavaParserConstants.PROTECTED is present.
|
isPublic | public static boolean isPublic(int[] mods)(Code) | | looks if JavaParserConstants.PUBLIC is present.
|
isStatic | public static boolean isStatic(int[] mods)(Code) | | looks if JavaParserConstants.PUBLIC is present.
|
makeChildsExpanded | public static void makeChildsExpanded(ParserTreeNode node, JTree tree, int numberOfLevels)(Code) | | makes the given number of levels childs expanded.
|
sortedInsert | public static void sortedInsert(ParserTreeNode node, ParserTreeNode destination)(Code) | | Used for fields and methods and constructors.
Uses node's sort order provided by the comparable interface.
|
toStringWithoutBraces | public static String toStringWithoutBraces(List> v)(Code) | | Simple helper.
|
|
|