public final class QuerySupport extends Object
public static SourceForBinaryQueryImplementation createCompiledSourceForBinaryQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots srcRoots, SourceRoots testRoots)
helper
- AntProjectHelper
used for resolving files, e.g. output directory.evaluator
- PropertyEvaluator
used for obtaining project properties.srcRoots
- a list of source roots.testRoots
- a list of test roots.SourceForBinaryQueryImplementation
to provide information about where Java sources can be found.SourceForBinaryQueryImplementation
@NonNull public static SourceForBinaryQueryImplementation createMultiModuleSourceForBinaryQuery(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator eval, @NonNull SourceRoots sourceModules, @NonNull SourceRoots srcRoots, @NonNull SourceRoots testModules, @NonNull SourceRoots testRoots)
SourceForBinaryQueryImplementation
for multi-module project.helper
- AntProjectHelper
used for resolving files, e.g. output directoryeval
- PropertyEvaluator
used for obtaining project propertiessourceModules
- the module rootssrcRoots
- the source rootstestModules
- the test module rootstestRoots
- the test source rootsSourceForBinaryQueryImplementation
public static SourceForBinaryQueryImplementation createCompiledSourceForBinaryQuery(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator evaluator, @NonNull SourceRoots srcRoots, @NullAllowed SourceRoots testRoots, @NonNull String[] binaryProperties, @NullAllowed String[] testBinaryProperties)
helper
- AntProjectHelper
used for resolving files, e.g. output directory.evaluator
- PropertyEvaluator
used for obtaining project properties.srcRoots
- a list of source roots.testRoots
- a list of test roots, may be null if the project does not support tests.binaryProperties
- array of property names of binary artifacts produced by this project, e.g. dist.jartestBinaryProperties
- array of property names of test binary artifacts produced by this project, e.g. build.test.classes.dir
If the testRoots parameter is null this parameter has to be null as well.SourceForBinaryQueryImplementation
to provide information about where Java sources can be found.SourceForBinaryQueryImplementation
public static FileEncodingQueryImplementation createFileEncodingQuery(PropertyEvaluator eval, String sourceEncodingPropertyName)
eval
- PropertyEvaluator
used for obtaining the value of source encoding.sourceEncodingPropertyName
- the source encoding property name.FileEncodingQueryImplementation
to provide information about encoding of a file.public static JavadocForBinaryQueryImplementation createJavadocForBinaryQuery(AntProjectHelper helper, PropertyEvaluator evaluator)
helper
- AntProjectHelper
used for resolving files, e.g. output directory.evaluator
- PropertyEvaluator
used for obtaining the Javadoc root.JavadocForBinaryQueryImplementation
to find Javadoc.@NonNull public static JavadocForBinaryQueryImplementation createMultiModuleJavadocForBinaryQuery(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator eval, @NonNull SourceRoots sourceModules, @NonNull SourceRoots srcRoots)
JavadocForBinaryQueryImplementation
for multi-module project.helper
- AntProjectHelper
used for resolving files, e.g. output directoryeval
- PropertyEvaluator
used for obtaining project propertiessourceModules
- the module rootssrcRoots
- the source rootsJavadocForBinaryQueryImplementation
public static JavadocForBinaryQueryImplementation createJavadocForBinaryQuery(AntProjectHelper helper, PropertyEvaluator evaluator, String[] binaryProperties)
helper
- AntProjectHelper
used for resolving files, e.g. output directory.evaluator
- PropertyEvaluator
used for obtaining the Javadoc root.binaryProperties
- array of property names of binary artifacts produced by this project, e.g. dist.jarJavadocForBinaryQueryImplementation
to find Javadoc.public static SharabilityQueryImplementation2 createSharabilityQuery2(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator evaluator, @NonNull SourceRoots srcRoots, @NullAllowed SourceRoots testRoots, @NullAllowed String... additionalSourceRoots)
helper
- AntProjectHelper
used for creating a query itself.evaluator
- a property evaluator
to interpret paths with.srcRoots
- a list of source roots to treat as sharable.testRoots
- a list of test roots to treat as sharable, may be null if the project does not support testsadditionalSourceRoots
- additional paths to treat as sharable (just pure property names, do not
use ${ and } characters). Can be null
.@Deprecated public static SharabilityQueryImplementation createSharabilityQuery(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator evaluator, @NonNull SourceRoots srcRoots, @NullAllowed SourceRoots testRoots, @NullAllowed String... additionalSourceRoots)
QuerySupport.createSharabilityQuery2(org.netbeans.spi.project.support.ant.AntProjectHelper, org.netbeans.spi.project.support.ant.PropertyEvaluator, org.netbeans.modules.java.api.common.SourceRoots, org.netbeans.modules.java.api.common.SourceRoots, java.lang.String...)
instead@Deprecated public static SharabilityQueryImplementation createSharabilityQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots srcRoots, SourceRoots testRoots)
QuerySupport.createSharabilityQuery2(org.netbeans.spi.project.support.ant.AntProjectHelper, org.netbeans.spi.project.support.ant.PropertyEvaluator, org.netbeans.modules.java.api.common.SourceRoots, org.netbeans.modules.java.api.common.SourceRoots, java.lang.String...)
instead@Deprecated public static SourceLevelQueryImplementation createSourceLevelQuery(PropertyEvaluator evaluator)
QuerySupport.createSourceLevelQuery(org.netbeans.spi.project.support.ant.PropertyEvaluator)
evaluator
- PropertyEvaluator
used for obtaining needed properties.SourceLevelQueryImplementation
to find out specification source level of Java source files.public static SourceLevelQueryImplementation2 createSourceLevelQuery2(@NonNull PropertyEvaluator evaluator)
evaluator
- PropertyEvaluator
used for obtaining needed properties.SourceLevelQueryImplementation2
to find out source level of Java source files.public static SourceLevelQueryImplementation2 createSourceLevelQuery2(@NonNull PropertyEvaluator evaluator, @NonNull String platformType)
evaluator
- PropertyEvaluator
used for obtaining needed properties.platformType
- the type of platform, for example "j2se"SourceLevelQueryImplementation2
to find out source level of Java source files.@NonNull public static CompilerOptionsQueryImplementation createCompilerOptionsQuery(@NonNull PropertyEvaluator evaluator, @NonNull String additionalCompilerOptionsProperty)
evaluator
- PropertyEvaluator
used for obtaining needed propertiesadditionalCompilerOptionsProperty
- the property holding the additional compiler optionsCompilerOptionsQueryImplementation
to find out explicit compiler options of Java source files.public static CompilerOptionsQueryImplementation createUnitTestsCompilerOptionsQuery(@NonNull PropertyEvaluator eval, @NonNull SourceRoots srcRoots, @NonNull SourceRoots testRoots)
eval
- the PropertyEvaluator
srcRoots
- the source rootstestRoots
- the test rootsCompilerOptionsQueryImplementation
to find out unit test compiler options@NonNull public static CompilerOptionsQueryImplementation createAutomaticModuleNameQuery(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator eval, @NonNull SourceRoots srcRoots, @NonNull String manifestProperty)
helper
- the AntProjectHelper
eval
- the PropertyEvaluator
srcRoots
- the source rootsmanifestProperty
- the property holding the path to the manifest fileCompilerOptionsQueryImplementation
to find out the Automatic-Module-Name@NonNull public static CompilerOptionsQueryImplementation createMultiModuleUnitTestsCompilerOptionsQuery(@NonNull Project project, @NonNull SourceRoots sourceModules, @NonNull SourceRoots sourceRoots, @NonNull SourceRoots testModules, @NonNull SourceRoots testRoots)
project
- the project to create a query forsourceModules
- the module rootssourceRoots
- the source rootstestModules
- the test module rootstestRoots
- the test source rootsCompilerOptionsQueryImplementation
to find out unit test compiler optionspublic static MultipleRootsUnitTestForSourceQueryImplementation createUnitTestForSourceQuery(SourceRoots sourceRoots, SourceRoots testRoots)
sourceRoots
- a list of source roots.testRoots
- a list of test roots.MultipleRootsUnitTestForSourceQueryImplementation
to find Java package roots of unit tests
for Java package root of sources and vice versa.@NonNull public static MultipleRootsUnitTestForSourceQueryImplementation createMultiModuleUnitTestForSourceQuery(@NonNull SourceRoots sourceModules, @NonNull SourceRoots sourceRoots, @NonNull SourceRoots testModules, @NonNull SourceRoots testRoots)
MultipleRootsUnitTestForSourceQueryImplementation
for a multi-module project.sourceModules
- the module rootssourceRoots
- the source rootstestModules
- the test module rootstestRoots
- the test source rootsMultipleRootsUnitTestForSourceQueryImplementation
public static FileBuiltQueryImplementation createFileBuiltQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots sourceRoots, SourceRoots testRoots)
helper
- AntProjectHelper
used for creating a query itself.evaluator
- PropertyEvaluator
used for obtaining needed properties.sourceRoots
- a list of source roots.testRoots
- a list of test roots.FileBuiltQueryImplementation
to test whether a file can be considered to be built (up to date).@NonNull public static FileBuiltQueryImplementation createMultiModuleFileBuiltQuery(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator evaluator, @NonNull SourceRoots sourceModules, @NonNull SourceRoots sourceRoots, @NonNull SourceRoots testModules, @NonNull SourceRoots testRoots)
FileBuiltQueryImplementation
for a multi-module project.helper
- the AntProjectHelper
evaluator
- the PropertyEvaluator
sourceModules
- the module rootssourceRoots
- the source rootstestModules
- the test module rootstestRoots
- the test source rootsFileBuiltQueryImplementation
instancepublic static CreateFromTemplateAttributesProvider createTemplateAttributesProvider(AntProjectHelper helper, FileEncodingQueryImplementation encodingQuery)
CreateFromTemplateAttributesProvider
providing
attributes for the project license and encoding.helper
- AntProjectHelper
used for reading the project properties.encodingQuery
- FileEncodingQueryImplementation
used to obtain an encoding.CreateFromTemplateAttributesProvider
.public static BinaryForSourceQueryImplementation createBinaryForSourceQueryImplementation(SourceRoots src, SourceRoots test, AntProjectHelper helper, PropertyEvaluator eval, String[] sourceProps, String[] testProps)
BinaryForSourceQueryImplementation
which maps given project source roots and test roots to given folders
with built classes and built test classes.src
- project source rootstest
- project test rootshelper
- AntProjectHelpereval
- PropertyEvaluatorsourceProps
- name of properties pointing to binariestestProps
- name of properties pointing to test binariespublic static BinaryForSourceQueryImplementation createBinaryForSourceQueryImplementation(SourceRoots src, SourceRoots test, AntProjectHelper helper, PropertyEvaluator eval)
QuerySupport.createBinaryForSourceQueryImplementation(org.netbeans.modules.java.api.common.SourceRoots, org.netbeans.modules.java.api.common.SourceRoots, org.netbeans.spi.project.support.ant.AntProjectHelper, org.netbeans.spi.project.support.ant.PropertyEvaluator, java.lang.String[], java.lang.String[])
which assumes that build classes folder is stored in property build.classes.dir
and
built test classes folder is stored in property build.test.classes.dir
.src
- project source rootstest
- project test rootshelper
- AntProjectHelpereval
- PropertyEvaluator@NonNull public static BinaryForSourceQueryImplementation createMultiModuleBinaryForSourceQuery(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator eval, @NonNull SourceRoots sourceModules, @NonNull SourceRoots srcRoots, @NonNull SourceRoots testModules, @NonNull SourceRoots testRoots)
BinaryForSourceQueryImplementation
for multi-module project.helper
- AntProjectHelper
used for resolving files, e.g. output directoryeval
- PropertyEvaluator
used for obtaining project propertiessourceModules
- the module rootssrcRoots
- the source rootstestModules
- the test module rootstestRoots
- the test source rootsBinaryForSourceQueryImplementation
public static AnnotationProcessingQueryImplementation createAnnotationProcessingQuery(AntProjectHelper helper, PropertyEvaluator evaluator, String annotationProcessingEnabledProperty, String annotationProcessingEnabledInEditorProperty, String runAllAnnotationProcessorsProperty, String annotationProcessorsProperty, String sourceOutputProperty, String processorOptionsProperty)
helper
- project's AntProjectHelperevaluator
- project's evaluatorannotationProcessingEnabledProperty
- property whose value says whether the annotation processing is enabled for the given project at all
(will be returned from AnnotationProcessingQuery.Result.annotationProcessingEnabled()
)annotationProcessingEnabledInEditorProperty
- property whose value says whether the annotation processing should be enabled
in the editor (will be returned from AnnotationProcessingQuery.Result.annotationProcessingEnabled()
)runAllAnnotationProcessorsProperty
- when true, AnnotationProcessingQuery.Result.annotationProcessorsToRun()
will return nullannotationProcessorsProperty
- should contain comma separated list of annotation processors to run (will be returned from AnnotationProcessingQuery.Result.annotationProcessorsToRun()
)sourceOutputProperty
- directory to which the annotation processors generate source files (will be returned from AnnotationProcessingQuery.Result.sourceOutputDirectory()
)processorOptionsProperty
- options passed to the annotation processors (-Akey=value)AnnotationProcessingQueryImplementation
to provide annotation processing configuration data for this project.public static ProjectInformation createProjectInformation(AntProjectHelper projectHelper, Project project, Icon icon)
public static ProjectInformation createProjectInformation(UpdateHelper updateHelper, Project project, Icon icon)
public static Sources createSources(@NonNull Project project, @NonNull AntProjectHelper helper, @NonNull PropertyEvaluator evaluator, @NonNull Roots... roots)
Sources
implementation designed for projects that supports adding
or removing of the source roots. The returned instance also implements SourceGroupModifierImplementation
project
- the Project
for which the Sources
should be createdhelper
- the AntProjectHelper
of the project, used only to resolve filesevaluator
- the PropertyEvaluator
to evaluate the propertiesroots
- the array of Roots
providing the roots of given typeSources
instance implementing also the SourceGroupModifierImplementation
interfacepublic static MultiModuleGroupQuery createMultiModuleGroupQuery(AntProjectHelper helper, PropertyEvaluator evaluator, Sources src, Roots... roots)
MultiModuleGroupQuery
implementation suitable for modular Java projects.helper
- the AntProjectHelper
of the project, used only to resolve filesevaluator
- the PropertyEvaluator
to evaluate the propertiesroots
- the array of Roots
providing the rootssrc
- Sources objects to track changes to project definition@NonNull public static AccessibilityQueryImplementation2 createModuleInfoAccessibilityQuery(@NonNull SourceRoots sources, @NonNull SourceRoots tests)
AccessibilityQueryImplementation2
based on the module-info.sources
- the project source rootstests
- the project test rootsAccessibilityQueryImplementation2
instance@NonNull public static AccessibilityQueryImplementation2 createModuleInfoAccessibilityQuery(@NonNull SourceRoots sourceModules, @NonNull SourceRoots sources, @NonNull SourceRoots testModules, @NonNull SourceRoots tests)
AccessibilityQueryImplementation2
based on the module-info for multi module projects.sourceModules
- the module rootssources
- the source rootstestModules
- the test module rootstests
- the test rootsAccessibilityQueryImplementation2
instance@NonNull public static AntArtifactProvider createMultiModuleAntArtifactProvider(@NonNull AntProjectHelper helper, @NonNull PropertyEvaluator eval, @NonNull SourceRoots sourceModules, @NonNull SourceRoots sources)
AntArtifactProvider
for multi-module project.helper
- the AntProjectHelper
eval
- the PropertyEvaluator
sourceModules
- the module rootssources
- the source rootsAntArtifactProvider
instance