src/main/Utils.java
public static String containsScope(String line) {
        for (int i = 0; i < ApexDoc.rgstrScope.length; i++) {
            String scope = ApexDoc.rgstrScope[i].toLowerCase();

            // if line starts with annotations, replace them, so
            // we can accurately use startsWith to match scope.
            line = stripAnnotations(line);
            line = line.toLowerCase().trim();

            // see if line starts with registered scopes.
            if (line.startsWith(scope + " ")) {
                return scope;
            }

            // match implicitly private lines
            else if (scope.equals(ApexDoc.PRIVATE)) {
                // match static props or methods:
                if (line.startsWith("static ")) {
                    return ApexDoc.PRIVATE;
                }

                // match methods that start with
                // keywords or return primitive types:
                for (String keyword : KEYWORDS) {
                    if (line.startsWith(keyword + " ") && line.contains("(")) {
                        return ApexDoc.PRIVATE;
                    }
                }

                // match metehods that return collections:
                for (String collection : COLLECTIONS) {
                    if (line.matches("^" + collection + "<.+>\\s.*") && line.contains("(")) {
                        return ApexDoc.PRIVATE;
                    }
                }
            }
        }
        return null;
    }
/**
    * See if line starts with scope keywords, if it does not, and
    * current scope is private, see if line starts with keyword or
    * primitive data type, or collection which would mean it is
    * implicitly private. This only works for methods in most cases,
    * otherwise we would be matching local variables as well. This is
    * why we check for '('. Unfortunately, we cannot check for all data
    * types, so if a method is not given an explicit access modifier &
    * it doesnt start with these keywords, it will be undetectable by ApexDoc2.
    */
See if line starts with scope keywords, if it does not, and
current scope is private, see if line starts with keyword or
primitive data type, or collection which would mean it is
implicitly private. This only works for methods in most cases,
otherwise we would be matching local variables as well. This is
why we check for '('. Unfortunately, we cannot check for all data
types, so if a method is not given an explicit access modifier &
it doesnt start with these keywords, it will be undetectable by ApexDoc2.
See if line starts with scope keywords if it does not and current scope is private see if line starts with keyword or primitive data type or collection which would mean it is implicitly private . This only works for methods in most cases otherwise we would be matching local variables as well . This is why we check for ' ( ' . Unfortunately we cannot check for all data types so if a method is not given an explicit access modifier & it doesnt start with these keywords it will be undetectable by ApexDoc2 .
public static String containsScope(String line) {
        for (int i = 0; i < ApexDoc.rgstrScope.length; i++) {
            String scope = ApexDoc.rgstrScope[i].toLowerCase();
            line = stripAnnotations(line);
            line = line.toLowerCase().trim();
            if (line.startsWith(scope + " ")) {
                return scope;
            }
            else if (scope.equals(ApexDoc.PRIVATE)) {
                if (line.startsWith("static ")) {
                    return ApexDoc.PRIVATE;
                }
                for (String keyword : KEYWORDS) {
                    if (line.startsWith(keyword + " ") && line.contains("(")) {
                        return ApexDoc.PRIVATE;
                    }
                }
                for (String collection : COLLECTIONS) {
                    if (line.matches("^" + collection + "<.+>\\s.*") && line.contains("(")) {
                        return ApexDoc.PRIVATE;
                    }
                }
            }
        }
        return null;
    }
public static String containsScope ( String line ) { for ( int i = 0 ; i < ApexDoc . rgstrScope . length ; i ++ ) { String scope = ApexDoc . rgstrScope [ i ] . toLowerCase ( ) ; line = stripAnnotations ( line ) ; line = line . toLowerCase ( ) . trim ( ) ; if ( line . startsWith ( scope + " " ) ) { return scope ; } else if ( scope . equals ( ApexDoc . PRIVATE ) ) { if ( line . startsWith ( "static " ) ) { return ApexDoc . PRIVATE ; } for ( String keyword : KEYWORDS ) { if ( line . startsWith ( keyword + " " ) && line . contains ( "(" ) ) { return ApexDoc . PRIVATE ; } } for ( String collection : COLLECTIONS ) { if ( line . matches ( "^" + collection + "<.+>\\s.*" ) && line . contains ( "(" ) ) { return ApexDoc . PRIVATE ; } } } } return null ; }
See if line starts with scope keywords, if it does not, and
 current scope is private, see if line starts with keyword or
 primitive data type, or collection which would mean it is
 implicitly private.
See if line starts with scope keywords if it does not and current scope is private see if line starts with keyword or primitive data type or collection which would mean it is implicitly private .
// if line starts with annotations, replace them, so // we can accurately use startsWith to match scope. // see if line starts with registered scopes. // match implicitly private lines // match static props or methods: // match methods that start with // keywords or return primitive types: // match metehods that return collections: