org.netbeans.modules.java.api.common/0 1.37

org.netbeans.modules.java.api.common.queries
Class QuerySupport

java.lang.Object
  extended by org.netbeans.modules.java.api.common.queries.QuerySupport

public final class QuerySupport
extends Object

Support class for creating different types of queries implementations.


Method Summary
static AnnotationProcessingQueryImplementation createAnnotationProcessingQuery(AntProjectHelper helper, PropertyEvaluator evaluator, String annotationProcessingEnabledProperty, String annotationProcessingEnabledInEditorProperty, String runAllAnnotationProcessorsProperty, String annotationProcessorsProperty, String sourceOutputProperty, String processorOptionsProperty)
          Create a new query to provide annotation processing configuration data.
static BinaryForSourceQueryImplementation createBinaryForSourceQueryImplementation(SourceRoots src, SourceRoots test, AntProjectHelper helper, PropertyEvaluator eval)
          Shortcut version of 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.
static BinaryForSourceQueryImplementation createBinaryForSourceQueryImplementation(SourceRoots src, SourceRoots test, AntProjectHelper helper, PropertyEvaluator eval, String sourceProp, String testProp)
          Creates an implementation of BinaryForSourceQueryImplementation which maps given project source roots and test roots to given folders with built classes and built test classes.
static SourceForBinaryQueryImplementation createCompiledSourceForBinaryQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots srcRoots, SourceRoots testRoots)
          Create a new query to provide information about where Java sources corresponding to binaries (classfiles) can be found.
static SourceForBinaryQueryImplementation createCompiledSourceForBinaryQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots srcRoots, SourceRoots testRoots, String[] binaryProperties, String[] testBinaryProperties)
          Create a new query to provide information about where Java sources corresponding to binaries (classfiles) can be found.
static FileBuiltQueryImplementation createFileBuiltQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots sourceRoots, SourceRoots testRoots)
          Create a new query to test whether a file can be considered to be built (up to date).
static FileEncodingQueryImplementation createFileEncodingQuery(PropertyEvaluator eval, String sourceEncodingPropertyName)
          Create a new query to provide information about encoding of a file.
static JavadocForBinaryQueryImplementation createJavadocForBinaryQuery(AntProjectHelper helper, PropertyEvaluator evaluator)
          Create a new query to find Javadoc.
static JavadocForBinaryQueryImplementation createJavadocForBinaryQuery(AntProjectHelper helper, PropertyEvaluator evaluator, String[] binaryProperties)
          Create a new query to find Javadoc.
static ProjectInformation createProjectInformation(AntProjectHelper projectHelper, Project project, Icon icon)
           
static ProjectInformation createProjectInformation(UpdateHelper updateHelper, Project project, Icon icon)
           
static SharabilityQueryImplementation createSharabilityQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots srcRoots, SourceRoots testRoots)
          Deprecated. since 1.35 use 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
static SharabilityQueryImplementation createSharabilityQuery(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots srcRoots, SourceRoots testRoots, String... additionalSourceRoots)
          Deprecated. since 1.35 use 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
static SharabilityQueryImplementation2 createSharabilityQuery2(AntProjectHelper helper, PropertyEvaluator evaluator, SourceRoots srcRoots, SourceRoots testRoots, String... additionalSourceRoots)
          Create a new query to provide information about files sharability.
static SourceLevelQueryImplementation createSourceLevelQuery(PropertyEvaluator evaluator)
          Deprecated. Use createSourceLevelQuery(org.netbeans.spi.project.support.ant.PropertyEvaluator)
static SourceLevelQueryImplementation2 createSourceLevelQuery2(PropertyEvaluator evaluator)
          Create a new query to find out source level of Java source files (SourceLevelQueryImplementation2).
static Sources createSources(Project project, AntProjectHelper helper, PropertyEvaluator evaluator, Roots... roots)
          Returns Sources implementation designed for projects that supports adding or removing of the source roots.
static CreateFromTemplateAttributesProvider createTemplateAttributesProvider(AntProjectHelper helper, FileEncodingQueryImplementation encodingQuery)
          Creates an implementation of CreateFromTemplateAttributesProvider providing attributes for the project license and encoding.
static MultipleRootsUnitTestForSourceQueryImplementation createUnitTestForSourceQuery(SourceRoots sourceRoots, SourceRoots testRoots)
          Create a new query to find Java package roots of unit tests for Java package root of sources and vice versa.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createCompiledSourceForBinaryQuery

public static SourceForBinaryQueryImplementation createCompiledSourceForBinaryQuery(AntProjectHelper helper,
                                                                                    PropertyEvaluator evaluator,
                                                                                    SourceRoots srcRoots,
                                                                                    SourceRoots testRoots)
Create a new query to provide information about where Java sources corresponding to binaries (classfiles) can be found.

Parameters:
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.
Returns:
SourceForBinaryQueryImplementation to provide information about where Java sources can be found.
See Also:
SourceForBinaryQueryImplementation

createCompiledSourceForBinaryQuery

public static SourceForBinaryQueryImplementation createCompiledSourceForBinaryQuery(@NonNull
                                                                                    AntProjectHelper helper,
                                                                                    @NonNull
                                                                                    PropertyEvaluator evaluator,
                                                                                    @NonNull
                                                                                    SourceRoots srcRoots,
                                                                                    @NullAllowed
                                                                                    SourceRoots testRoots,
                                                                                    @NonNull
                                                                                    String[] binaryProperties,
                                                                                    @NullAllowed
                                                                                    String[] testBinaryProperties)
Create a new query to provide information about where Java sources corresponding to binaries (classfiles) can be found.

Parameters:
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.jar
testBinaryProperties - 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.
Returns:
SourceForBinaryQueryImplementation to provide information about where Java sources can be found.
Since:
org.netbeans.modules.java.api.common/0 1.3
See Also:
SourceForBinaryQueryImplementation

createFileEncodingQuery

public static FileEncodingQueryImplementation createFileEncodingQuery(PropertyEvaluator eval,
                                                                      String sourceEncodingPropertyName)
Create a new query to provide information about encoding of a file. The returned query listens to the changes in particular property values.

Parameters:
eval - PropertyEvaluator used for obtaining the value of source encoding.
sourceEncodingPropertyName - the source encoding property name.
Returns:
a FileEncodingQueryImplementation to provide information about encoding of a file.

createJavadocForBinaryQuery

public static JavadocForBinaryQueryImplementation createJavadocForBinaryQuery(AntProjectHelper helper,
                                                                              PropertyEvaluator evaluator)
Create a new query to find Javadoc. The returned query listens on changes of the Javadoc directory.

Parameters:
helper - AntProjectHelper used for resolving files, e.g. output directory.
evaluator - PropertyEvaluator used for obtaining the Javadoc root.
Returns:
a JavadocForBinaryQueryImplementation to find Javadoc.

createJavadocForBinaryQuery

public static JavadocForBinaryQueryImplementation createJavadocForBinaryQuery(AntProjectHelper helper,
                                                                              PropertyEvaluator evaluator,
                                                                              String[] binaryProperties)
Create a new query to find Javadoc. The returned query listens on changes of the Javadoc directory.

Parameters:
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.jar
Returns:
a JavadocForBinaryQueryImplementation to find Javadoc.
Since:
org.netbeans.modules.java.api.common/0 1.3

createSharabilityQuery2

public static SharabilityQueryImplementation2 createSharabilityQuery2(@NonNull
                                                                      AntProjectHelper helper,
                                                                      @NonNull
                                                                      PropertyEvaluator evaluator,
                                                                      @NonNull
                                                                      SourceRoots srcRoots,
                                                                      @NullAllowed
                                                                      SourceRoots testRoots,
                                                                      @NullAllowed
                                                                      String... additionalSourceRoots)
Create a new query to provide information about files sharability. The returned query listens to the changes in particular source roots.

Parameters:
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 tests
additionalSourceRoots - additional paths to treat as sharable (just pure property names, do not use ${ and } characters). Can be null.
Returns:
a query to provide information about files sharability.
Since:
1.35

createSharabilityQuery

@Deprecated
public static SharabilityQueryImplementation createSharabilityQuery(@NonNull
                                                                               AntProjectHelper helper,
                                                                               @NonNull
                                                                               PropertyEvaluator evaluator,
                                                                               @NonNull
                                                                               SourceRoots srcRoots,
                                                                               @NullAllowed
                                                                               SourceRoots testRoots,
                                                                               @NullAllowed
                                                                               String... additionalSourceRoots)
Deprecated. since 1.35 use 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


createSharabilityQuery

@Deprecated
public static SharabilityQueryImplementation createSharabilityQuery(AntProjectHelper helper,
                                                                               PropertyEvaluator evaluator,
                                                                               SourceRoots srcRoots,
                                                                               SourceRoots testRoots)
Deprecated. since 1.35 use 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


createSourceLevelQuery

@Deprecated
public static SourceLevelQueryImplementation createSourceLevelQuery(PropertyEvaluator evaluator)
Deprecated. Use createSourceLevelQuery(org.netbeans.spi.project.support.ant.PropertyEvaluator)

Create a new query to find out specification source level of Java source files.

Parameters:
evaluator - PropertyEvaluator used for obtaining needed properties.
Returns:
a SourceLevelQueryImplementation to find out specification source level of Java source files.

createSourceLevelQuery2

public static SourceLevelQueryImplementation2 createSourceLevelQuery2(@NonNull
                                                                      PropertyEvaluator evaluator)
Create a new query to find out source level of Java source files (SourceLevelQueryImplementation2).

Parameters:
evaluator - PropertyEvaluator used for obtaining needed properties.
Returns:
a SourceLevelQueryImplementation2 to find out source level of Java source files.
Since:
1.22

createUnitTestForSourceQuery

public static MultipleRootsUnitTestForSourceQueryImplementation createUnitTestForSourceQuery(SourceRoots sourceRoots,
                                                                                             SourceRoots testRoots)
Create a new query to find Java package roots of unit tests for Java package root of sources and vice versa.

Parameters:
sourceRoots - a list of source roots.
testRoots - a list of test roots.
Returns:
a MultipleRootsUnitTestForSourceQueryImplementation to find Java package roots of unit tests for Java package root of sources and vice versa.

createFileBuiltQuery

public static FileBuiltQueryImplementation createFileBuiltQuery(AntProjectHelper helper,
                                                                PropertyEvaluator evaluator,
                                                                SourceRoots sourceRoots,
                                                                SourceRoots testRoots)
Create a new query to test whether a file can be considered to be built (up to date). The returned query listens to the changes in particular source roots.

Parameters:
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.
Returns:
a FileBuiltQueryImplementation to test whether a file can be considered to be built (up to date).

createTemplateAttributesProvider

public static CreateFromTemplateAttributesProvider createTemplateAttributesProvider(AntProjectHelper helper,
                                                                                    FileEncodingQueryImplementation encodingQuery)
Creates an implementation of CreateFromTemplateAttributesProvider providing attributes for the project license and encoding.

Parameters:
helper - AntProjectHelper used for reading the project properties.
encodingQuery - FileEncodingQueryImplementation used to obtain an encoding.
Returns:
a CreateFromTemplateAttributesProvider.
Since:
1.1

createBinaryForSourceQueryImplementation

public static BinaryForSourceQueryImplementation createBinaryForSourceQueryImplementation(SourceRoots src,
                                                                                          SourceRoots test,
                                                                                          AntProjectHelper helper,
                                                                                          PropertyEvaluator eval,
                                                                                          String sourceProp,
                                                                                          String testProp)
Creates an implementation of BinaryForSourceQueryImplementation which maps given project source roots and test roots to given folders with built classes and built test classes.

Parameters:
src - project source roots
test - project test roots
helper - AntProjectHelper
eval - PropertyEvaluator
sourceProp - name of property pointing to a folder with built classes
testProp - name of property pointing to a folder with built test classes
Returns:
BinaryForSourceQueryImplementation
Since:
org.netbeans.modules.java.api.common/1 1.5

createBinaryForSourceQueryImplementation

public static BinaryForSourceQueryImplementation createBinaryForSourceQueryImplementation(SourceRoots src,
                                                                                          SourceRoots test,
                                                                                          AntProjectHelper helper,
                                                                                          PropertyEvaluator eval)
Shortcut version of 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.

Parameters:
src - project source roots
test - project test roots
helper - AntProjectHelper
eval - PropertyEvaluator
sourceProps - array of properties pointing to source folders
testProps - array of properties pointing to test folders
Returns:
BinaryForSourceQueryImplementation
Since:
org.netbeans.modules.java.api.common/1 1.5

createAnnotationProcessingQuery

public static AnnotationProcessingQueryImplementation createAnnotationProcessingQuery(AntProjectHelper helper,
                                                                                      PropertyEvaluator evaluator,
                                                                                      String annotationProcessingEnabledProperty,
                                                                                      String annotationProcessingEnabledInEditorProperty,
                                                                                      String runAllAnnotationProcessorsProperty,
                                                                                      String annotationProcessorsProperty,
                                                                                      String sourceOutputProperty,
                                                                                      String processorOptionsProperty)
Create a new query to provide annotation processing configuration data.

Parameters:
helper - project's AntProjectHelper
evaluator - project's evaluator
annotationProcessingEnabledProperty - property whose value says whether the annotation processing is enabled for the given project at all (will be returned from Result#annotationProcessingEnabled())
annotationProcessingEnabledInEditorProperty - property whose value says whether the annotation processing should be enabled in the editor (will be returned from Result#annotationProcessingEnabled())
runAllAnnotationProcessorsProperty - when true, Result#annotationProcessorsToRun() will return null
annotationProcessorsProperty - should contain comma separated list of annotation processors to run (will be returned from Result#annotationProcessorsToRun())
sourceOutputProperty - directory to which the annotation processors generate source files (will be returned from Result#sourceOutputProperty())
processorOptionsProperty - options passed to the annotation processors (-Akey=value)
Returns:
a AnnotationProcessingQueryImplementation to provide annotation processing configuration data for this project.
Since:
org.netbeans.modules.java.api.common/0 1.14

createProjectInformation

public static ProjectInformation createProjectInformation(AntProjectHelper projectHelper,
                                                          Project project,
                                                          Icon icon)

createProjectInformation

public static ProjectInformation createProjectInformation(UpdateHelper updateHelper,
                                                          Project project,
                                                          Icon icon)

createSources

public static Sources createSources(@NonNull
                                    Project project,
                                    @NonNull
                                    AntProjectHelper helper,
                                    @NonNull
                                    PropertyEvaluator evaluator,
                                    @NonNull
                                    Roots... roots)
Returns Sources implementation designed for projects that supports adding or removing of the source roots. The returned instance also implements SourceGroupModifierImplementation

Parameters:
project - the Project for which the Sources should be created
helper - the AntProjectHelper of the project, used only to resolve files
evaluator - the PropertyEvaluator to evaluate the properties
roots - the array of Roots providing the roots of given type
Returns:
the Sources instance implementing also the SourceGroupModifierImplementation interface
Since:
1.21

org.netbeans.modules.java.api.common/0 1.37

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.