[apex] Internalize ApexParser and ApexHandler

This commit is contained in:
Andreas Dangel
2020-06-20 19:25:09 +02:00
parent eed1c6cab2
commit 23c08b52b2
4 changed files with 23 additions and 0 deletions

View File

@ -103,6 +103,11 @@ The command line version of PMD continues to use **scala 2.13**.
[Testing your implementation](pmd_devdocs_major_adding_new_cpd_language.html#testing-your-implementation) [Testing your implementation](pmd_devdocs_major_adding_new_cpd_language.html#testing-your-implementation)
in the developer documentation. in the developer documentation.
#### Internal API
* {% jdoc apex::lang.apex.ApexParser %}
* {% jdoc apex::lang.apex.ApexHandler %}
### External Contributions ### External Contributions
* [#2349](https://github.com/pmd/pmd/pull/2349): \[java] Optimize UnusedPrivateMethodRule - [shilko2013](https://github.com/shilko2013) * [#2349](https://github.com/pmd/pmd/pull/2349): \[java] Optimize UnusedPrivateMethodRule - [shilko2013](https://github.com/shilko2013)

View File

@ -8,6 +8,7 @@ import java.io.Writer;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.lang.AbstractLanguageVersionHandler; import net.sourceforge.pmd.lang.AbstractLanguageVersionHandler;
import net.sourceforge.pmd.lang.Parser; import net.sourceforge.pmd.lang.Parser;
import net.sourceforge.pmd.lang.ParserOptions; import net.sourceforge.pmd.lang.ParserOptions;
@ -26,6 +27,11 @@ import net.sourceforge.pmd.lang.metrics.internal.AbstractLanguageMetricsProvider
import net.sourceforge.pmd.lang.rule.RuleViolationFactory; import net.sourceforge.pmd.lang.rule.RuleViolationFactory;
/**
* @deprecated Internal API
*/
@Deprecated
@InternalApi
public class ApexHandler extends AbstractLanguageVersionHandler { public class ApexHandler extends AbstractLanguageVersionHandler {
private final ApexMetricsProvider myMetricsProvider = new ApexMetricsProvider(); private final ApexMetricsProvider myMetricsProvider = new ApexMetricsProvider();

View File

@ -7,7 +7,9 @@ package net.sourceforge.pmd.lang.apex;
import java.io.Reader; import java.io.Reader;
import java.util.Map; import java.util.Map;
import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.lang.AbstractParser; import net.sourceforge.pmd.lang.AbstractParser;
import net.sourceforge.pmd.lang.LanguageVersionHandler;
import net.sourceforge.pmd.lang.ParserOptions; import net.sourceforge.pmd.lang.ParserOptions;
import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.Node;
@ -15,7 +17,11 @@ import net.sourceforge.pmd.lang.ast.ParseException;
/** /**
* Adapter for the Apex jorje parser * Adapter for the Apex jorje parser
*
* @deprecated This is internal API, use {@link LanguageVersionHandler#getParser(ParserOptions)}.
*/ */
@InternalApi
@Deprecated
public class ApexParser extends AbstractParser { public class ApexParser extends AbstractParser {
private net.sourceforge.pmd.lang.apex.ast.ApexParser apexParser; private net.sourceforge.pmd.lang.apex.ast.ApexParser apexParser;

View File

@ -10,6 +10,7 @@ import java.util.Map;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.lang.apex.ApexJorjeLogging; import net.sourceforge.pmd.lang.apex.ApexJorjeLogging;
import net.sourceforge.pmd.lang.apex.ApexParserOptions; import net.sourceforge.pmd.lang.apex.ApexParserOptions;
import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.ParseException;
@ -23,6 +24,11 @@ import apex.jorje.semantic.ast.compilation.UserTrigger;
import apex.jorje.semantic.ast.visitor.AdditionalPassScope; import apex.jorje.semantic.ast.visitor.AdditionalPassScope;
import apex.jorje.semantic.ast.visitor.AstVisitor; import apex.jorje.semantic.ast.visitor.AstVisitor;
/**
* @deprecated Internal API
*/
@InternalApi
@Deprecated
public class ApexParser { public class ApexParser {
protected final ApexParserOptions parserOptions; protected final ApexParserOptions parserOptions;