Package org.glassfish.spec
Class Spec
java.lang.Object
org.glassfish.spec.Spec
The API specification.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
ArtifactId suffix for Spec withapi
JarType.private String
The Spec API Package.private Artifact
The Spec Artifact.The errors during spec verification.private String
The Spec Implementation Builder Number.private String
The Spec Implementation Namespace.private String
The Spec Implementation Version.static final String
GroupId used for JakartaEE specs.private JarFile
The Spec JAR file.private Spec.JarType
The Spec Jar Type seeSpec.JarType
.static final String
GroupId used for JavaEE specs.private static final String
Constant for JCP Version Rule.private Metadata
The Spec Artifact Metadata.private String
The Spec Implementation Version.private String
The new Spec Version (for non final API).private boolean
The Spec Final flag.private static final String
Constant for Non Final API Build Separator.private static final String
Constant for Non Final API Build Spec Separator.private String
The Spec Build Number.private String
The Spec Implementation Version.private SpecMode
The Spec mode ("javaee"
or"jakarta"
).private String
The Spec Version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuild bundle symbolic name from API package and API_SUFFIX.private void
checkClasses
(JarFile jarfile, String... pkgs) Verify that the classes inside the given jarFile match the right package.Get the Spec Artifact.Get the errors collected during verification.Get the Spec Metadata.void
Populate the spec artifact and metadata from the given JAR file.void
setApiPackage
(String pkg) Set the API package for this spec.void
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.toString()
Create a readable inline description of the spec.void
verify()
Perform the Spec verification.private void
Verify that apiPackage starts with proper prefix.
-
Field Details
-
JAVAX_GROUP_ID
GroupId used for JavaEE specs.- See Also:
-
JAKARTA_GROUP_ID
GroupId used for JakartaEE specs.- See Also:
-
artifact
The Spec Artifact. -
metadata
The Spec Artifact Metadata. -
jar
The Spec JAR file. -
specMode
The Spec mode ("javaee"
or"jakarta"
). Default value isinvalid reference
SpecMode.JAKARTA
-
specVersion
The Spec Version. -
newSpecVersion
The new Spec Version (for non final API). -
specImplVersion
The Spec Implementation Version. -
implVersion
The Spec Implementation Version. -
newImplVersion
The Spec Implementation Version. -
specBuild
The Spec Build Number. -
implBuild
The Spec Implementation Builder Number. -
apiPackage
The Spec API Package. -
implNamespace
The Spec Implementation Namespace. -
nonFinal
private boolean nonFinalThe Spec Final flag. -
jarType
The Spec Jar Type seeSpec.JarType
. -
errors
The errors during spec verification. -
NONFINAL_BUILD_SEPARATOR_SPEC
Constant for Non Final API Build Spec Separator.- See Also:
-
NONFINAL_BUILD_SEPARATOR
Constant for Non Final API Build Separator.- See Also:
-
JCP_VERSION_RULE
Constant for JCP Version Rule.- See Also:
-
API_SUFFIX
ArtifactId suffix for Spec withapi
JarType.- See Also:
-
-
Constructor Details
-
Spec
public Spec()Create a new instance ofSpec
.
-
-
Method Details
-
read
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
-
checkClasses
Verify that the classes inside the given jarFile match the right package.- Parameters:
jarfile
- the JAR file to processpkgs
- the packages to match
-
verifyApiPackagePrefix
private void verifyApiPackagePrefix()Verify that apiPackage starts with proper prefix. Verification depends on current spec mode:- javaee: strict check for required prefix
- jakarta: both currently supported prefixes are allowed
-
verify
public void verify()Perform the Spec verification. -
getArtifact
Get the Spec Artifact.- Returns:
- the artifact
-
getMetadata
Get the Spec Metadata.- Returns:
- the metadata
-
getErrors
Get the errors collected during verification.- Returns:
- the list of errors
-
setSpecMode
Set spec mode value for this spec.- Parameters:
name
- spec mode value matching lower case value ofSpecMode
name attribute
-
setApiPackage
Set the API package for this spec.- Parameters:
pkg
- the apiPackage to use
-
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
Set the implementation namespace for this spec.- Parameters:
namespace
- the implementation namespace
-
setImplVersion
Set the implementation version for this spec.- Parameters:
version
- the implementation version
-
setSpecVersion
Set the spec version for this spec.- Parameters:
version
- the spec version
-
setNewImplVersion
Set the new spec implementation version for this spec.- Parameters:
version
- the spec version
-
setSpecBuild
Set the spec build for this spec.- Parameters:
build
- the spec build
-
setSpecImplVersion
Set the spec implementation version for this spec.- Parameters:
version
- the spec implementation version
-
setNewSpecVersion
Set the new spec version for this spec.- Parameters:
version
- the new spec version
-
setImplBuild
Set the implementation build for this spec.- Parameters:
build
- the implementation build
-
setArtifact
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
Set the spec JAR type.- Parameters:
type
- the JAR type to use
-
setMetadata
Set metadata for this spec.- Parameters:
mdata
- the metadata use
-
toString
Create a readable inline description of the spec.
-