Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
/ lib-tag Public archive

`Lib-Tag` is a library to use and handle easily [Tag]s in your [JavaFX] & [Maven] application. A `Tag` is a simple [String] which can be used for example in a [Button], [Label] or another [JavaFX] components. Suchlike tagged topics can be easily searched or analyzed for a `Tag`.

License

Notifications You must be signed in to change notification settings

Naoghuman/lib-tag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lib-Tag

license: GPL v3 GitHub release

Intention

The sublibrary Lib-Tag-Core contains the core functionalities to perform the CRUD (Create, Read, Update and Delete) operations for a Tag.

A Tag is a simple String which can be used for example in a Button, Label or another JavaFX components. Suchlike tagged topics can be easily searched or analyzed for a Tag.

Image: UML Lib-Tag
uml_lib-tag_v0.4.0_2019-06-13_19-10.png

Hint
The UML diagram is created with the Online Modeling Platform GenMyModel.

Content

Examples

Usage of the class TagBuilder

It is very easy to create a Tag with the fluent builder TagBuilder:

/**
 * With the fluent builder {@code Class} {@link com.github.naoghuman.lib.tag.core.TagBuilder} 
 * the developer can easily create an instance from the {@code Interface} 
 * {@link com.github.naoghuman.lib.tag.core.Tag}.
 * <ul>
 * <li>The first two attributes {@code id} and {@code title} are mandory.</li>
 * <li>All other attributes are optional, that means skipping them returns {@link java.util.Optional#empty()}.</li>
 * <li>Any attribute (mandory or optional if set) will be validate against {@link com.github.naoghuman.lib.tag.internal.DefaultTagValidator}.</li>
 * </ul>
 *
 * @author  Naoghuman
 * @since   0.1.0
 * @version 0.4.0
 * @see     com.github.naoghuman.lib.tag.core.Tag
 * @see     com.github.naoghuman.lib.tag.core.TagBuilder
 * @see     com.github.naoghuman.lib.tag.internal.DefaultTagValidator
 * @see     java.util.Optional#empty()
 */
final Tag tag = TagBuilder.create()
        .id(Tag.DEFAULT_ID)               // mandory (NOT NULL)
        .title("title")                   // mandory (NOT NULL && NOT EMPTY)
        .generationTime(Long.MIN_VALUE)   // mandory (NOT NULL)
        .description("description")       // optional
        .style("style")                   // optional
        .build();

The same as a Business process modeling (BPM) diagram (create with the tool Bizagi Modeler BPMN):
Image: Business process modeling diagram from TagBuilder
bpm_lib-tag-core_tagbuilder_2017-12-17_08-23.png

Hint
. The generation from a Tag starts with the method create().
. Green rectangles are mandory attributes.
. Blue rectangles are optional attributes.
. The Tag will then created with the last method build().

Additional informations

Usage of the class TagContainerIdBuilder

To identify the container and the assoziated Tags from the container a unique id is required. Here comes the following fluent builder in the game:

/**
 * With the fluent builder {@code Class} {@link com.github.naoghuman.lib.tag.core.TagContainerIdBuilder} 
 * the developer can create easily an unique {@code Id} and returned it as a {@link java.lang.String}.
 * <p>
 * The main point from this {@code builder} is the possibility to generate an unique {@code Id} for a relation 
 * between a {@link com.github.naoghuman.lib.tag.core.Tag} and the container where the {@code Tag} will be embbeded.
 * 
 * <ul>
 * <li>All attributes are {@code mandory}.</li>
 * <li>All defined values will be validate against the {@code Interface} {@link com.github.naoghuman.lib.tag.internal.DefaultTagValidator}.</li>
 * </ul>
 *
 * @author  Naoghuman
 * @since   0.4.0
 * @version 0.4.0
 * @see     com.github.naoghuman.lib.tag.core.Tag
 * @see     com.github.naoghuman.lib.tag.core.TagRelation
 * @see     com.github.naoghuman.lib.tag.internal.DefaultTagValidator
 */
final String tagContainerId = TagContainerIdBuilder.create()
        .path(TagContainerId.class)         // mandory (NOT NULL)
        .container(AnchorPane.class)        // mandory (NOT NULL)
        .containerId("container-id")        // mandory (NOT NULL && NOT EMPTY)
        .build();

Again the same as a Business process modeling (BPM) diagram:
Image: Business process modeling diagram from TagContainerIdBuilder
bpm_lib-tag-core_tagrelationcontaineridbuilder_2017-12-17_08-32.png

Hint
. The generation from a TagContainerId starts with the method create().
. Green rectangles are mandory attributes.
. The TagContainerId will then created with the last method build().

Additional informations

Usage of the class TagRelationBuilder

With a TagRelation its possible to map a Tag with a specific gui component. So the application knows which Tags should be shown for example in a Button or in a FlowPane.

/**
 * With the fluent builder {@code Class} {@link com.github.naoghuman.lib.tag.core.TagRelationBuilder} 
 * the developer can create easily an instance from the {@code Interface} 
 * {@link com.github.naoghuman.lib.tag.core.TagRelation}.
 * <ul>
 * <li>All attributes are {@code mandory}.</li>
 * <li>All defined values will be validate against the {@code Interface} {@link com.github.naoghuman.lib.tag.internal.DefaultTagValidator}.</li>
 * </ul>
 *
 * @author  Naoghuman
 * @since   0.1.0
 * @version 0.4.0
 * @see     com.github.naoghuman.lib.tag.core.TagRelation
 * @see     com.github.naoghuman.lib.tag.core.TagRelationBuilder
 * @see     com.github.naoghuman.lib.tag.internal.DefaultTagValidator
 */
final TagRelation tagRelation = TagRelationBuilder.create()
        .id(TagRelation.DEFAULT_ID)                         // mandory (NOT NULL)
        .tagId(0L)                                          // mandory (NOT NULL)
        .containerId(TagContainerIdBuilder.create()
                .path(TagContainerId.class)                 // mandory (NOT NULL)
                .container(AnchorPane.class)                // mandory (NOT NULL)
                .containerId("container-id")                // mandory (NOT NULL && NOT EMPTY)
                .build())
        .build();

The same like above as a Business process modeling (BPM) diagram (create with the tool Bizagi Modeler BPMN):
Image: Business process modeling diagram from TagRelationBuilder
bpm_lib-tag-core_tagreleationbuilder_2017-11-25_22-42.png

Hint
. The generation from a TagRelation starts with the method create().
. Green rectangles are mandory attributes.
. The TagRelation will then created with the last method build().

Additional informations

JavaDoc

The JavaDoc from the library Lib-TAG can be explored here: JavaDoc Lib-Tag

Image: JavaDoc Lib-Tag v0.4.0 javadoc_lib-tag_v0.4.0_2019-06-16_11-34.png

Download

Current version is 0.4.0. Main points in this release are:

  • ...
  • ...

Download:

Maven:

<!-- https://mvnrepository.com/artifact/com.github.naoghuman/lib-tag -->
<dependency>
    <groupId>com.github.naoghuman</groupId>
    <artifactId>lib-tag</artifactId>
    <version>0.4.0</version>
</dependency>

An overview about all existings releases can be found here:

  • Overview from all releases in Lib-Tag.

Requirements

In the library following dependencies are registered:

  • No additional relationship

Installation

License

The project Lib-Tag and all sub-projects are licensed under General Public License 3.0.

Autor

The project Lib-Tile and all sub-projects are maintained by me, Peter Rogge. See Contact.

Contact

You can reach me under peter.rogge@yahoo.de.

About

`Lib-Tag` is a library to use and handle easily [Tag]s in your [JavaFX] & [Maven] application. A `Tag` is a simple [String] which can be used for example in a [Button], [Label] or another [JavaFX] components. Suchlike tagged topics can be easily searched or analyzed for a `Tag`.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages