Package org.glassfish.spec
Class Spec
- java.lang.Object
-
- org.glassfish.spec.Spec
-
public class Spec extends Object
The API specification.- Author:
- Romain Grecourt
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Spec.JarType
The different kind of Spec Jar files.
-
Field Summary
Fields Modifier and Type Field Description static String
API_SUFFIX
ArtifactId suffix for Spec withapi
JarType.static String
JAKARTA_GROUP_ID
GroupId used for JakartaEE specs.static String
JAVAX_GROUP_ID
GroupId used for JavaEE specs.
-
Constructor Summary
Constructors Constructor Description Spec()
Create a new instance ofSpec
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
buildBundleSymbolicName()
Build bundle symbolic name from API package and API_SUFFIX.Artifact
getArtifact()
Get the Spec Artifact.List<String>
getErrors()
Get the errors collected during verification.Metadata
getMetadata()
Get the Spec Metadata.void
read(JarFile jarfile)
Populate the spec artifact and metadata from the given JAR file.void
setApiPackage(String pkg)
Set the API package for this spec.void
setArtifact(Artifact a)
Set the artifact for this spec.void
setImplBuild(String build)
Set the implementation build for this spec.void
setImplNamespace(String namespace)
Set the implementation namespace for this spec.void
setImplVersion(String version)
Set the implementation version for this spec.void
setJarType(String type)
Set the spec JAR type.void
setMetadata(Metadata mdata)
Set metadata for this spec.void
setNewImplVersion(String version)
Set the new spec implementation version for this spec.void
setNewSpecVersion(String version)
Set the new spec version for this spec.void
setNonFinal(boolean nfinal)
Set the spec non final flag.void
setSpecBuild(String build)
Set the spec build for this spec.void
setSpecImplVersion(String version)
Set the spec implementation version for this spec.void
setSpecMode(String name)
Set spec mode value for this spec.void
setSpecVersion(String version)
Set the spec version for this spec.String
toString()
Create a readable inline description of the spec.void
verify()
Perform the Spec verification.
-
-
-
Field Detail
-
JAVAX_GROUP_ID
public static final String JAVAX_GROUP_ID
GroupId used for JavaEE specs.- See Also:
- Constant Field Values
-
JAKARTA_GROUP_ID
public static final String JAKARTA_GROUP_ID
GroupId used for JakartaEE specs.- See Also:
- Constant Field Values
-
API_SUFFIX
public static final String API_SUFFIX
ArtifactId suffix for Spec withapi
JarType.- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public void read(JarFile jarfile) throws IOException
Populate the spec artifact and metadata from the given JAR file.- Parameters:
jarfile
- the JAR file to process- Throws:
IOException
- if an error occurs while reading the JAR file
-
verify
public void verify()
Perform the Spec verification.
-
getArtifact
public Artifact getArtifact()
Get the Spec Artifact.- Returns:
- the artifact
-
getMetadata
public Metadata getMetadata()
Get the Spec Metadata.- Returns:
- the metadata
-
getErrors
public List<String> getErrors()
Get the errors collected during verification.- Returns:
- the list of errors
-
setSpecMode
public void setSpecMode(String name)
Set spec mode value for this spec.- Parameters:
name
- spec mode value matching lower case value ofSpecMode
name attribute
-
setApiPackage
public void setApiPackage(String pkg)
Set the API package for this spec.- Parameters:
pkg
- the apiPackage to use
-
buildBundleSymbolicName
public String buildBundleSymbolicName()
Build bundle symbolic name from API package and API_SUFFIX.- Returns:
- bundle symbolic name value to be supplied
as
spec.bundle.symbolic-name
property.
-
setImplNamespace
public void setImplNamespace(String namespace)
Set the implementation namespace for this spec.- Parameters:
namespace
- the implementation namespace
-
setImplVersion
public void setImplVersion(String version)
Set the implementation version for this spec.- Parameters:
version
- the implementation version
-
setSpecVersion
public void setSpecVersion(String version)
Set the spec version for this spec.- Parameters:
version
- the spec version
-
setNewImplVersion
public void setNewImplVersion(String version)
Set the new spec implementation version for this spec.- Parameters:
version
- the spec version
-
setSpecBuild
public void setSpecBuild(String build)
Set the spec build for this spec.- Parameters:
build
- the spec build
-
setSpecImplVersion
public void setSpecImplVersion(String version)
Set the spec implementation version for this spec.- Parameters:
version
- the spec implementation version
-
setNewSpecVersion
public void setNewSpecVersion(String version)
Set the new spec version for this spec.- Parameters:
version
- the new spec version
-
setImplBuild
public void setImplBuild(String build)
Set the implementation build for this spec.- Parameters:
build
- the implementation build
-
setArtifact
public void setArtifact(Artifact a)
Set the artifact for this spec.- Parameters:
a
- the artifact to use
-
setNonFinal
public void setNonFinal(boolean nfinal)
Set the spec non final flag.- Parameters:
nfinal
- the non final value to use
-
setJarType
public void setJarType(String type)
Set the spec JAR type.- Parameters:
type
- the JAR type to use
-
setMetadata
public void setMetadata(Metadata mdata)
Set metadata for this spec.- Parameters:
mdata
- the metadata use
-
-