public abstract class GroupedSource extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GroupedSource.Type
The type of grouped source entry this object represents.
|
static interface |
GroupedSource.Visitor |
Constructor and Description |
---|
GroupedSource() |
Modifier and Type | Method and Description |
---|---|
protected void |
check() |
String |
getName(java.util.function.Function<SourcePath,Path> pathResolver) |
protected abstract Optional<List<GroupedSource>> |
getSourceGroup() |
protected abstract Optional<String> |
getSourceGroupName() |
protected abstract Optional<Path> |
getSourceGroupPathRelativeToTarget() |
protected abstract Optional<SourcePath> |
getSourcePath() |
protected abstract Optional<SourceWithFlags> |
getSourceWithFlags() |
protected abstract GroupedSource.Type |
getType() |
static GroupedSource |
ofIgnoredSource(SourcePath sourcePath)
Creates a
GroupedSource given a SourcePath representing a file that should not
be included in sources. |
static GroupedSource |
ofPrivateHeader(SourcePath headerPath)
Creates a
GroupedSource given a SourcePath representing a private header file. |
static GroupedSource |
ofPublicHeader(SourcePath headerPath)
Creates a
GroupedSource given a SourcePath representing a public header file. |
static GroupedSource |
ofSourceGroup(String sourceGroupName,
Path sourceGroupPathRelativeToTarget,
Collection<GroupedSource> sourceGroup)
Creates a
GroupedSource given a source group name and a list of GroupedSources. |
static GroupedSource |
ofSourceWithFlags(SourceWithFlags sourceWithFlags)
Creates a
GroupedSource given a SourceWithFlags . |
void |
visit(GroupedSource.Visitor visitor) |
protected abstract GroupedSource.Type getType()
protected abstract Optional<SourceWithFlags> getSourceWithFlags()
protected abstract Optional<SourcePath> getSourcePath()
protected abstract Optional<Path> getSourceGroupPathRelativeToTarget()
protected abstract Optional<List<GroupedSource>> getSourceGroup()
@Value.Check protected void check()
public String getName(java.util.function.Function<SourcePath,Path> pathResolver)
public static GroupedSource ofSourceWithFlags(SourceWithFlags sourceWithFlags)
GroupedSource
given a SourceWithFlags
.public static GroupedSource ofIgnoredSource(SourcePath sourcePath)
GroupedSource
given a SourcePath
representing a file that should not
be included in sources.public static GroupedSource ofPublicHeader(SourcePath headerPath)
GroupedSource
given a SourcePath
representing a public header file.public static GroupedSource ofPrivateHeader(SourcePath headerPath)
GroupedSource
given a SourcePath
representing a private header file.public static GroupedSource ofSourceGroup(String sourceGroupName, Path sourceGroupPathRelativeToTarget, Collection<GroupedSource> sourceGroup)
GroupedSource
given a source group name and a list of GroupedSources.public void visit(GroupedSource.Visitor visitor)