public class Extension extends Object
An extension can be in one of these states
This class is not thread-safe.
ExtensionType| Modifier and Type | Field and Description |
|---|---|
static String |
EXTENSION_NAME_ASSEMBLED_FEATURES
Extension name containing the assembled features as produced by
FeatureBuilder.assemble(ArtifactId, BuilderContext, Feature...). |
static String |
EXTENSION_NAME_CONTENT_PACKAGES
Common extension name to specify the content packages for Apache Sling.
|
static String |
EXTENSION_NAME_REPOINIT
Common extension name to specify the repoinit part for Apache Sling.
|
| Constructor and Description |
|---|
Extension(ExtensionType t,
String name,
boolean required)
Deprecated.
|
Extension(ExtensionType type,
String name,
ExtensionState state)
Create a new extension
|
| Modifier and Type | Method and Description |
|---|---|
Extension |
copy()
Create a copy of the Extension
|
boolean |
equals(Object obj) |
Artifacts |
getArtifacts()
Get the artifacts of the extension
|
String |
getJSON()
Get the JSON of the extension
|
javax.json.JsonStructure |
getJSONStructure()
Get the JSON structure of the extension
|
String |
getName()
Get the extension name
|
ExtensionState |
getState()
Get the extension state
|
String |
getText()
Get the text of the extension
|
ExtensionType |
getType()
Get the extension type
|
int |
hashCode() |
boolean |
isOptional()
Deprecated.
Use
getState() |
boolean |
isRequired()
Deprecated.
Use
getState() |
void |
setJSON(String text)
Set the JSON of the extension
|
void |
setJSONStructure(javax.json.JsonStructure struct)
Set the JSON structure of the extension
|
void |
setText(String text)
Set the text of the extension
|
String |
toString() |
public static final String EXTENSION_NAME_REPOINIT
ExtensionType.TEXT and is required.public static final String EXTENSION_NAME_CONTENT_PACKAGES
ExtensionType.ARTIFACTS and is required.public static final String EXTENSION_NAME_ASSEMBLED_FEATURES
FeatureBuilder.assemble(ArtifactId, BuilderContext, Feature...).
This extension is of type ExtensionType.ARTIFACTS and is optional.@Deprecated public Extension(ExtensionType t, String name, boolean required)
Extension(ExtensionType, String, ExtensionState)t - The type of the extensionname - The name of the extensionrequired - Whether the extension is required or optionalIllegalArgumentException - If name or t are nullpublic Extension(ExtensionType type, String name, ExtensionState state)
type - The type of the extensionname - The name of the extensionstate - The state of the extensionIllegalArgumentException - If name, type or state is nullpublic ExtensionType getType()
public ExtensionState getState()
public String getName()
@Deprecated public boolean isRequired()
getState()true if the extension is required.@Deprecated public boolean isOptional()
getState()true if the extension is optional.public String getText()
IllegalStateException - if the type is not ExtensionType#TEXTpublic void setText(String text)
text - The textIllegalStateException - if the type is not ExtensionType#TEXTpublic String getJSON()
nullIllegalStateException - if the type is not ExtensionType#JSONpublic void setJSON(String text)
text - The JSONIllegalStateException - if the type is not
ExtensionType#JSONIllegalArgumentException - If the structure is not validpublic javax.json.JsonStructure getJSONStructure()
nullIllegalStateException - if the type is not ExtensionType#JSONpublic void setJSONStructure(javax.json.JsonStructure struct)
struct - The JSON structureIllegalStateException - if the type is not
ExtensionType#JSONIllegalArgumentException - If the structure is not validpublic Artifacts getArtifacts()
IllegalStateException - if the type is not
ExtensionType#ARTIFACTSpublic Extension copy()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.