Class JavaPath
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.artifactModel.Path
-
- net.ssehub.easy.instantiation.core.model.artifactModel.JavaPath
-
- All Implemented Interfaces:
IStringValueProvider,IVilType
public class JavaPath extends Path
Represents a Java path.pathscan be converted to Java paths under certain circumstances and v.v.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider
IStringValueProvider.StringComparator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringcheckJavaPath(java.lang.String path)Checks the given path for compliance to Java path conventions.static JavaPathconvert(java.lang.String val)Conversion operation.voiddeleteAll()Deletes all files in the given path.java.lang.StringgetName()Returns the simple name of this artifact.java.lang.StringgetPackage()Returns the package part of this path.java.lang.StringgetPath()Returns the path represented by this instance.java.lang.StringgetPathSegments()Returns the path segments of this path (excluding the names).JavaPathgetPathSegmentsPath()Returns the path segments as Java path.java.lang.StringgetStringValue(IStringValueProvider.StringComparator comparator)Returns the string value of this object.voidmkdir()Creates the directories pointing to path.JavaPathtoJavaPath()Turns this path into a java package name.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.artifactModel.Path
concat, concat, convert, copy, create, createInstance, createInstance, createInstance, delete, exists, getAbsolutePath, getArtifactModel, getParent, isPattern, isTemporary, lastModification, matches, move, rename, selectAll, selectByKind, selectByType, toAbsoluteOSPath, toJavaPath, toOSPath, toString, typeReject
-
-
-
-
Constructor Detail
-
JavaPath
protected JavaPath(Path path) throws VilException
Creates a new java path from a given path.- Parameters:
path- the path to create this java path from- Throws:
VilException- in case that path cannot be converted
-
JavaPath
protected JavaPath(Path path, java.lang.String prefixRegEx) throws VilException
Creates a new java path from a given path.- Parameters:
path- the path to create this java path fromprefixRegEx- an optional regular expression (intended for prefixes) to be replaced by the empty string (may be null)- Throws:
VilException- in case that path cannot be converted
-
-
Method Detail
-
checkJavaPath
private static java.lang.String checkJavaPath(java.lang.String path) throws VilExceptionChecks the given path for compliance to Java path conventions.- Parameters:
path- the path to be checked- Returns:
path- Throws:
VilException- in case that the path does not comply to Java conventions
-
toJavaPath
public JavaPath toJavaPath() throws VilException
Description copied from class:PathTurns this path into a java package name.- Overrides:
toJavaPathin classPath- Returns:
- the related java Package name
- Throws:
VilException- in case that the related Java path cannot be created
-
deleteAll
public void deleteAll()
Deletes all files in the given path.
-
getPath
public java.lang.String getPath()
Description copied from class:PathReturns the path represented by this instance. This path may be a pattern.
-
getName
public java.lang.String getName() throws VilExceptionDescription copied from class:PathReturns the simple name of this artifact.- Overrides:
getNamein classPath- Returns:
- the simple name
- Throws:
VilException- in case that the operation cannot continue
-
getPathSegments
public java.lang.String getPathSegments()
Description copied from class:PathReturns the path segments of this path (excluding the names).- Overrides:
getPathSegmentsin classPath- Returns:
- the path segments
-
getPathSegmentsPath
public JavaPath getPathSegmentsPath()
Returns the path segments as Java path.- Returns:
- the path segments
-
getPackage
public java.lang.String getPackage()
Returns the package part of this path.- Returns:
- the package part
-
getStringValue
public java.lang.String getStringValue(IStringValueProvider.StringComparator comparator)
Description copied from interface:IStringValueProviderReturns the string value of this object.- Specified by:
getStringValuein interfaceIStringValueProvider- Overrides:
getStringValuein classPath- Parameters:
comparator- if the sequence of elements, e.g., in case of collections, shall be ordered according to the comparator, null if the original sequence shall be returned- Returns:
- the string value
-
convert
public static JavaPath convert(java.lang.String val)
Conversion operation.- Parameters:
val- the value to be converted- Returns:
- the converted value
-
-