Package org.apache.sling.feature.maven.mojos.apis

# Class ApisUtil

java.lang.Object
org.apache.sling.feature.maven.mojos.apis.ApisUtil

public class ApisUtil extends Object
Context for creating the api jars

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`API_IDS`
Alternative IDs for artifact dependencies.
`static final String`
`IGNORE_PACKAGES`
Ignore packages for api generation
`static final String`
`JAVADOC_CLASSPATH`
Additional artifacts for javadoc classpath
`static final String`
`JAVADOC_LINKS`
Links for javadocs.
`static final String`
`SCM_CLASSIFIER`
Alternative classifier for the source artifact.
`static final String`
`SCM_ENCODING`
Alternative SCM encoding, default is UTF-8
`static final String`
`SCM_IDS`
Alternative IDS to a source artifact.
`static final String`
`SCM_LOCATION`
Alternative SCM location.
`static final String`
`SCM_TAG`
Tag for source when using SCM info

## Constructor Summary

Constructors
Constructor
Description
`ApisUtil()`

## Method Summary

Modifier and Type
Method
Description
`static Map<org.apache.sling.feature.ArtifactId,String>`
`buildJavadocClasspath(org.apache.maven.plugin.logging.Log log, org.apache.maven.repository.RepositorySystem repositorySystem, org.apache.maven.execution.MavenSession mavenSession, org.apache.sling.feature.ArtifactId artifactId)`
`static List<org.apache.sling.feature.Artifact>`
`getAdditionalJavadocArtifacts(ApisJarContext context, String regionName)`
Get all artifacts from the configured extensions
`static List<org.apache.sling.feature.ArtifactId>`
`getApiIds(org.apache.sling.feature.Artifact artifact)`
`static Set<String>`
`getIgnoredPackages(org.apache.sling.feature.Artifact bundle)`
`static Collection<String>`
`getJavadocClassPath(org.apache.maven.plugin.logging.Log log, org.apache.maven.repository.RepositorySystem repositorySystem, org.apache.maven.execution.MavenSession mavenSession, ApisJarContext ctx, String regionName)`
Build the classpath for javadoc
`static List<String>`
`getJavadocLinks(org.apache.sling.feature.Artifact artifact)`
`static void`
`getPackageList(String javadocUrl, Set<String> linkedPackages, Map<String,Set<String>> linkedPackagesMap)`
`static Map.Entry<Set<String>,Set<String>>`
`getPackages(ApisJarContext ctx, File file, String extension)`
Get all packages contained in the archive
`static List<Processor>`
`getProcessors(boolean includeProviderTypeResource)`
Get the list of processors
`static List<org.apache.sling.feature.ArtifactId>`
`getSourceIds(org.apache.sling.feature.Artifact artifact)`
`static void`
`validateSourceInfo(org.apache.sling.feature.Artifact artifact)`
Validate that only one source metadata is set
`static void`
`writeSourceReport(boolean write, org.apache.maven.plugin.logging.Log log, File reportFile, List<ApisJarContext.ArtifactInfo> infos)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### SCM_TAG

public static final String SCM_TAG
Tag for source when using SCM info

See Also:
  - Constant Field Values

### SCM_LOCATION

public static final String SCM_LOCATION
Alternative SCM location.

See Also:
  - Constant Field Values

### SCM_ENCODING

public static final String SCM_ENCODING
Alternative SCM encoding, default is UTF-8

See Also:
  - Constant Field Values

### API_IDS

public static final String API_IDS
Alternative IDs for artifact dependencies.

See Also:
  - Constant Field Values

### SCM_IDS

public static final String SCM_IDS
Alternative IDS to a source artifact.

See Also:
  - Constant Field Values

### SCM_CLASSIFIER

public static final String SCM_CLASSIFIER
Alternative classifier for the source artifact.

See Also:
  - Constant Field Values

### JAVADOC_LINKS

public static final String JAVADOC_LINKS
Links for javadocs.

See Also:
  - Constant Field Values

### JAVADOC_CLASSPATH

public static final String JAVADOC_CLASSPATH
Additional artifacts for javadoc classpath

See Also:
  - Constant Field Values

### IGNORE_PACKAGES

public static final String IGNORE_PACKAGES
Ignore packages for api generation

See Also:
  - Constant Field Values

## Constructor Details

### ApisUtil

public ApisUtil()

## Method Details

### getSourceIds

public static List<org.apache.sling.feature.ArtifactId> getSourceIds(org.apache.sling.feature.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException

Throws:
  `org.apache.maven.plugin.MojoExecutionException`

### getApiIds

public static List<org.apache.sling.feature.ArtifactId> getApiIds(org.apache.sling.feature.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException

Throws:
  `org.apache.maven.plugin.MojoExecutionException`

### getJavadocLinks

public static List<String> getJavadocLinks(org.apache.sling.feature.Artifact artifact)

### getPackageList

public static void getPackageList(String javadocUrl, Set<String> linkedPackages, Map<String,Set<String>> linkedPackagesMap) throws org.apache.maven.plugin.MojoExecutionException

Throws:
  `org.apache.maven.plugin.MojoExecutionException`

### getIgnoredPackages

public static Set<String> getIgnoredPackages(org.apache.sling.feature.Artifact bundle)

### validateSourceInfo

public static void validateSourceInfo(org.apache.sling.feature.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
Validate that only one source metadata is set

Parameters:
  `artifact` - The artifact to check
Throws:
  `org.apache.maven.plugin.MojoExecutionException` - If metadata information is invalid

### getJavadocClassPath

public static Collection<String> getJavadocClassPath(org.apache.maven.plugin.logging.Log log, org.apache.maven.repository.RepositorySystem repositorySystem, org.apache.maven.execution.MavenSession mavenSession, ApisJarContext ctx, String regionName) throws org.apache.maven.plugin.MojoExecutionException
Build the classpath for javadoc

Parameters:
  `log` - The log to use
  `repositorySystem` - The repository system to use
  `mavenSession` - The maven session to use
  `ctx` - The Apis Jar Context to use
  `regionName` - The region name to use
Returns:
  The computed javadoc classpath
Throws:
  `org.apache.maven.plugin.MojoExecutionException` - When an invalid artifact ID is found

### buildJavadocClasspath

public static Map<org.apache.sling.feature.ArtifactId,String> buildJavadocClasspath(org.apache.maven.plugin.logging.Log log, org.apache.maven.repository.RepositorySystem repositorySystem, org.apache.maven.execution.MavenSession mavenSession, org.apache.sling.feature.ArtifactId artifactId) throws org.apache.maven.plugin.MojoExecutionException

Throws:
  `org.apache.maven.plugin.MojoExecutionException`

### getProcessors

public static List<Processor> getProcessors(boolean includeProviderTypeResource)
Get the list of processors

Returns:
  The processors - might be empty

### getPackages

public static Map.Entry<Set<String>,Set<String>> getPackages(ApisJarContext ctx, File file, String extension) throws org.apache.maven.plugin.MojoExecutionException
Get all packages contained in the archive

Parameters:
  `ctx` - The generation context
  `file` - The archive to check
  `extension` - The extension to check for
Returns:
  A tuple of packages containing files with the extension and packages with files not having the extension
Throws:
  `org.apache.maven.plugin.MojoExecutionException` - If processing fails

### getAdditionalJavadocArtifacts

public static List<org.apache.sling.feature.Artifact> getAdditionalJavadocArtifacts(ApisJarContext context, String regionName) throws org.apache.maven.plugin.MojoExecutionException
Get all artifacts from the configured extensions

Parameters:
  `context` - The context
  `regionName` - The name of the region
Returns:
  A list of artifacts, might be empty
Throws:
  `org.apache.maven.plugin.MojoExecutionException` - If processing fails or configuration is invalid

### writeSourceReport

public static void writeSourceReport(boolean write, org.apache.maven.plugin.logging.Log log, File reportFile, List<ApisJarContext.ArtifactInfo> infos) throws org.apache.maven.plugin.MojoExecutionException

Throws:
  `org.apache.maven.plugin.MojoExecutionException`