You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2020/07/07 09:35:23 UTC
[sling-org-apache-sling-graphql-core] branch master updated:
trivial: corrected javadoc
This is an automated email from the ASF dual-hosted git repository.
radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git
The following commit(s) were added to refs/heads/master by this push:
new 9ff7870 trivial: corrected javadoc
9ff7870 is described below
commit 9ff78709ffe70f6a360c55502d67202de920150c
Author: Radu Cotescu <co...@adobe.com>
AuthorDate: Tue Jul 7 11:34:50 2020 +0200
trivial: corrected javadoc
---
pom.xml | 20 ++++++++++++++++++++
.../apache/sling/graphql/api/SchemaProvider.java | 1 +
.../apache/sling/graphql/api/SlingDataFetcher.java | 5 ++---
.../graphql/api/SlingDataFetcherEnvironment.java | 22 +++++++++++++++-------
.../sling/graphql/api/SlingScalarConverter.java | 13 +++++++++++--
5 files changed, 49 insertions(+), 12 deletions(-)
diff --git a/pom.xml b/pom.xml
index 440a41c..0ebd6bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -296,4 +296,24 @@
</dependency>
</dependencies>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>javadoc</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ <configuration>
+ <stylesheet>maven</stylesheet>
+ <excludePackageNames>*.core:*.impl:*.internal:${site.javadoc.exclude}</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
</project>
diff --git a/src/main/java/org/apache/sling/graphql/api/SchemaProvider.java b/src/main/java/org/apache/sling/graphql/api/SchemaProvider.java
index e6feb41..e44748b 100644
--- a/src/main/java/org/apache/sling/graphql/api/SchemaProvider.java
+++ b/src/main/java/org/apache/sling/graphql/api/SchemaProvider.java
@@ -36,6 +36,7 @@ public interface SchemaProvider {
* @return a GraphQL schema that can be annotated to define the data fetchers to use, see
* this module's documentation. Can return null if a schema cannot be provided, in which
* case a different provider should be used.
+ * @throws java.io.IOException if the schema cannot be retrieved
*/
@Nullable
String getSchema(@NotNull Resource r, @Nullable String [] selectors) throws IOException;
diff --git a/src/main/java/org/apache/sling/graphql/api/SlingDataFetcher.java b/src/main/java/org/apache/sling/graphql/api/SlingDataFetcher.java
index 78d4c4e..142f2ae 100644
--- a/src/main/java/org/apache/sling/graphql/api/SlingDataFetcher.java
+++ b/src/main/java/org/apache/sling/graphql/api/SlingDataFetcher.java
@@ -26,8 +26,7 @@ import org.osgi.annotation.versioning.ConsumerType;
/**
* Retrieves data for a given GraphQL field. Services must be registered with a
* NAME property with a unique value that's matched with the
- * corresponding @directive in the GraphQL Schema. The name must match the
- * {@link GraphQLResourceQuery.FETCHER_NAME_PATTERN} regular expression.
+ * corresponding @directive in the GraphQL Schema.
*/
@ConsumerType
public interface SlingDataFetcher<T> {
@@ -35,4 +34,4 @@ public interface SlingDataFetcher<T> {
@Nullable
T get(@NotNull SlingDataFetcherEnvironment e) throws Exception;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/graphql/api/SlingDataFetcherEnvironment.java b/src/main/java/org/apache/sling/graphql/api/SlingDataFetcherEnvironment.java
index 6e640cc..c557145 100644
--- a/src/main/java/org/apache/sling/graphql/api/SlingDataFetcherEnvironment.java
+++ b/src/main/java/org/apache/sling/graphql/api/SlingDataFetcherEnvironment.java
@@ -29,7 +29,8 @@ import org.osgi.annotation.versioning.ProviderType;
@ProviderType
public interface SlingDataFetcherEnvironment {
- /** The parent object of the field that's being retrieved */
+
+ /** @return the parent object of the field that's being retrieved */
@Nullable
Object getParentObject();
@@ -37,23 +38,30 @@ public interface SlingDataFetcherEnvironment {
@Nullable
Map<String, Object> getArguments();
- /** @return a single argument, passed to the GraphQL query */
+ /**
+ * @param <T> the argument type
+ * @param name the name of the argument to return
+ * @return a single argument, passed to the GraphQL query */
@Nullable
<T> T getArgument(String name);
- /** @return a single argument, passed to the GraphQL query */
+ /**
+ * @param <T> the argument type
+ * @param name the name of the argument to return
+ * @param defaultValue the default value to return
+ * @return a single argument, passed to the GraphQL query */
@Nullable
<T> T getArgument(String name, T defaultValue);
- /** Get the current Sling resource */
+ /** @return the current Sling resource */
@Nullable
Resource getCurrentResource();
- /** Options, if set by the schema directive */
+ /** @return the options, if set by the schema directive */
@Nullable
String getFetcherOptions();
- /** Source, if set by the schema directive */
+ /** @return the source, if set by the schema directive */
@Nullable
String getFetcherSource();
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/sling/graphql/api/SlingScalarConverter.java b/src/main/java/org/apache/sling/graphql/api/SlingScalarConverter.java
index 1d51b8b..b0e81d6 100644
--- a/src/main/java/org/apache/sling/graphql/api/SlingScalarConverter.java
+++ b/src/main/java/org/apache/sling/graphql/api/SlingScalarConverter.java
@@ -26,7 +26,7 @@ import org.osgi.annotation.versioning.ConsumerType;
* A service that parses and serializes a custom GraphQL Scalar by
* converting between an eXternal type X an an inTernal one T.
*
- * Instances of this service must have a {@link SlingScalarConverter.NAME}
+ * Instances of this service must have a {@link SlingScalarConverter#NAME_SERVICE_PROPERTY}
* service property which is the name of the scalar type.
*/
@ConsumerType
@@ -34,12 +34,21 @@ public interface SlingScalarConverter<T, X> {
String NAME_SERVICE_PROPERTY = "name";
- /** Parse an external value (a query argument for example) into its internal representation */
+ /** Parse an external value (a query argument for example) into its internal representation
+ *
+ * @param input the external value to parse
+ * @return the internal representation of the passed input
+ * @throws ScalarConversionException if the parsing operation fails
+ **/
@Nullable
T parseValue(@Nullable X input) throws ScalarConversionException;
/** Serialize an internal value (provided by a {@link SlingDataFetcher} into its
* external representation.
+ *
+ * @param value the internal value
+ * @return the external representation of the internal value
+ * @throws ScalarConversionException if the serialization operation fails
*/
@Nullable
X serialize(@Nullable T value) throws ScalarConversionException;