public final class Devon4jPackage extends Object
Package following the
devonfw coding convetion. Package as Devon4jPackage you can get individual parts/segments such as
compoent, layer, scope, etc.of(String),
of(Package),
of(Class)| Modifier and Type | Field and Description |
|---|---|
private String |
detail |
static String |
LAYER_BATCH
The batch layer.
|
static String |
LAYER_CLIENT
The client layer.
|
static String |
LAYER_COMMON
The common "layer" for cross-cutting
code.
|
static String |
LAYER_DATA_ACCESS
The data-access layer.
|
static String |
LAYER_LOGIC
The logic layer.
|
static String |
LAYER_SERVICE
The service layer.
|
private static Set<String> |
LAYERS |
private String |
pkg |
private static String |
REGEX_PKG_SEPARATOR |
private String |
root |
static String |
SCOPE_API
The scope for APIs.
|
static String |
SCOPE_BASE
The scope for reusable base
implementations.
|
static String |
SCOPE_IMPL
The scope for implementations.
|
private int |
scopeIndex |
private static Set<String> |
SCOPES |
private String[] |
segments |
private Boolean |
valid |
| Modifier | Constructor and Description |
|---|---|
private |
Devon4jPackage(String pkg,
String[] segments,
String root,
String detail,
int scope)
Der Konstruktor.
|
public static final String LAYER_COMMON
public static final String LAYER_DATA_ACCESS
public static final String LAYER_LOGIC
public static final String LAYER_SERVICE
public static final String LAYER_BATCH
public static final String LAYER_CLIENT
public static final String SCOPE_API
public static final String SCOPE_BASE
public static final String SCOPE_IMPL
private static final String REGEX_PKG_SEPARATOR
private final String[] segments
private final int scopeIndex
private Boolean valid
private transient String root
private transient String detail
private transient String pkg
private Devon4jPackage(String pkg, String[] segments, String root, String detail, int scope)
segments - - see getSegment(int).scope - - see getScope().private static boolean isValidSegment(String segment)
public int getSegmentCount()
package segments.public String getSegment(int index)
index - the position of the requested segment. A valid index is in the range from 0 to
getSegmentCount()-1.Package segment at the given index or null if the given index is invalid.public boolean isValid()
true if this Devon4jPackage is a valid according to devonfw
package conventions",
false otherwise.private boolean isValidInternal()
public boolean isValidScope()
public boolean isValidLayer()
public String getRoot()
Package of the organization or IT project owning the code.public String getApplication()
public String getComponent()
public String getLayer()
public boolean isLayerCommon()
true if layer is LAYER_COMMON.public boolean isLayerDataAccess()
true if layer is LAYER_DATA_ACCESS.public boolean isLayerLogic()
true if layer is LAYER_LOGIC.public boolean isLayerService()
true if layer is LAYER_SERVICE.public boolean isLayerBatch()
true if layer is LAYER_BATCH.public boolean isLayerClient()
true if layer is LAYER_CLIENT.public String getScope()
public boolean isScopeBase()
true if scope is SCOPE_BASE.public boolean isScopeImpl()
true if scope is SCOPE_IMPL.public String getDetail()
null.private String joinPackage(int start)
private String joinPackage(int start, int end)
public static Devon4jPackage of(String root, String application, String component, String layer, String scope, String detail)
root - - see getRoot().application - - see getApplication().component - - see getComponent().layer - - see getLayer().scope - - see getScope().detail - - see getDetail().Devon4jPackage for the given parameters.public static Devon4jPackage of(String packageName)
packageName - the package name to parse.Devon4jPackage corresponding to the given package.public static Devon4jPackage of(Package javaPackage)
javaPackage - the Package to parse.Devon4jPackage corresponding to the given package.public static Devon4jPackage of(Class<?> type)
Copyright © 2014–2019 devon4j-Team. All rights reserved.