Lib-Tag-Components

TODO

License

License

GroupId

GroupId

com.github.naoghuman
ArtifactId

ArtifactId

lib-tag-components
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Lib-Tag-Components
TODO
Project URL

Project URL

https://github.com/Naoghuman/lib-tag.git
Source Code Management

Source Code Management

https://github.com/Naoghuman/lib-tag.git

Download lib-tag-components

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.naoghuman/lib-tag-components/ -->
<dependency>
    <groupId>com.github.naoghuman</groupId>
    <artifactId>lib-tag-components</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.naoghuman/lib-tag-components/
implementation 'com.github.naoghuman:lib-tag-components:0.2.0'
// https://jarcasting.com/artifacts/com.github.naoghuman/lib-tag-components/
implementation ("com.github.naoghuman:lib-tag-components:0.2.0")
'com.github.naoghuman:lib-tag-components:jar:0.2.0'
<dependency org="com.github.naoghuman" name="lib-tag-components" rev="0.2.0">
  <artifact name="lib-tag-components" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.naoghuman', module='lib-tag-components', version='0.2.0')
)
libraryDependencies += "com.github.naoghuman" % "lib-tag-components" % "0.2.0"
[com.github.naoghuman/lib-tag-components "0.2.0"]

Dependencies

compile (4)

Group / Artifact Type Version
com.github.naoghuman : lib-logger jar 0.5.0
com.github.naoghuman : lib-action jar 0.5.0
com.github.naoghuman : lib-tag-core jar 0.2.0
com.airhacks : afterburner.fx jar 1.7.0

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19
org.hamcrest : hamcrest-core jar 1.3

Project Modules

There are no modules declared in this project.

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.

Versions

Version
0.2.0