[python] Deprecate/Internalize PythonTokenManager

Refs #2293
This commit is contained in:
Andreas Dangel
2020-03-13 10:30:30 +01:00
parent c2f35584ca
commit b487ef94d0
2 changed files with 10 additions and 1 deletions

View File

@ -27,6 +27,7 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr
* {% jdoc vm::lang.vm.VmTokenManager %} * {% jdoc vm::lang.vm.VmTokenManager %}
* {% jdoc java::lang.java.JavaTokenManager %} * {% jdoc java::lang.java.JavaTokenManager %}
* {% jdoc python::lang.python.PythonTokenManager %}
### External Contributions ### External Contributions

View File

@ -1,4 +1,4 @@
/** /*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/ */
@ -6,13 +6,21 @@ package net.sourceforge.pmd.lang.python;
import java.io.Reader; import java.io.Reader;
import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.cpd.Language;
import net.sourceforge.pmd.cpd.Tokenizer;
import net.sourceforge.pmd.lang.TokenManager; import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.ast.SimpleCharStream; import net.sourceforge.pmd.lang.ast.SimpleCharStream;
import net.sourceforge.pmd.lang.python.ast.PythonParserTokenManager; import net.sourceforge.pmd.lang.python.ast.PythonParserTokenManager;
/** /**
* Python Token Manager implementation. * Python Token Manager implementation.
*
* @deprecated This is internal API, use {@link Tokenizer#tokenize(net.sourceforge.pmd.cpd.SourceCode, net.sourceforge.pmd.cpd.Tokens)}
* via {@link Language#getTokenizer()}.
*/ */
@Deprecated
@InternalApi
public class PythonTokenManager implements TokenManager { public class PythonTokenManager implements TokenManager {
private final PythonParserTokenManager tokenManager; private final PythonParserTokenManager tokenManager;