-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/optionalLabels-CMEM-1897' into release/3.6.0
- Loading branch information
Showing
82 changed files
with
273 additions
and
238 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
silk-core/src/main/scala/org/silkframework/config/HasMetaData.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.silkframework.config | ||
|
||
import org.silkframework.util.Identifier | ||
|
||
/** | ||
* Inherited by classes that provide an identifier and metadata. | ||
*/ | ||
trait HasMetaData { | ||
|
||
/** | ||
* The unique identifier for this object. | ||
*/ | ||
def id: Identifier | ||
|
||
/** | ||
* The metadata for this object. | ||
*/ | ||
def metaData: MetaData | ||
|
||
/** | ||
* Returns a label for this object. | ||
* Per default, it will fall back to generating a label from the identifier, if no label is defined. | ||
* Subclasses may override this behaviour. | ||
* Truncates the label to maxLength characters. | ||
* | ||
* @param maxLength the max length in characters | ||
*/ | ||
def label(maxLength: Int = MetaData.DEFAULT_LABEL_MAX_LENGTH)(implicit prefixes: Prefixes = Prefixes.empty): String = { | ||
metaData.formattedLabel(MetaData.labelFromId(id), maxLength) | ||
} | ||
|
||
/** | ||
* Returns a label for this object with no length restriction. | ||
*/ | ||
def fullLabel(implicit prefixes: Prefixes = Prefixes.empty): String = label(Int.MaxValue) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.