GithubHelp home page GithubHelp logo

ololx / cranberry Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 6.22 MB

The cranberry is a java library that allows to write less code - it's automatically plugs into your project build and sweets up your java.

License: Apache License 2.0

Java 100.00%
java java-library code-generation javac annotations annotation-processor annotation-processing annotation-tool maven

cranberry's Introduction

Cranberry

             ___/\\ /\  
            / _//| \ /  
           / / / |/ \__ 000   000
           |/ /  / /  000       000
      00 00 _/   |/ 000       ^   000
   00 ^     00   | 000     <  *  > 000  
  00< * >    00 0 0 000       v   000
   00 v     00 0 * 0  000       000
      00 00     0 0     000   000
________________________________________
Cranberry          

The Cranberry is a java library that allows to write less routine code. It's automatically plugs into you build during compilation and sweets up your project.

Maven Central Sonatype Nexus Release Sonatype Nexus Snapshot javadoc

tag release

osslifecycle last_commit release_date

DeepSource Codacy Badge

licence Contributor Covenant FOSSA Status

repo_size languages_code_size languages_count languages_top

requires_java

๐Ÿ“‡ Table of Contents

๐Ÿ“– About

The Cranberry is a java library that allows to write less routine code. It's automatically plugs into you build during compilation and sweets up your project.

Motivation

Sometimes it wants frequently used code to be generated automatically. Especially if such code is not generated by existing libraries.

Modules

The cranberry project includes the follows modules:

  • cranberry commons - this module provides a general realisation of simple tools and wrappers which are used in another cranberry modules for the automatically code generating during compilation;
  • cranberry muffin - this module is designed to combine the possibilities of thematically grouped modules into one common library;
  • cranberry statement - this module provides an api for the statements validation (such as not null and e.t.c.). This module includes an annotations for the injecting methods of this api into code during compilation;
  • cranberry logging - this module provides an api for the loggint method params;
  • cranberry data - this module provides an api for the java data manipulations: varianbles modifiers, default values, e.t.c. This module includes an annotations for the injecting methods of this api into code during compilation;
  • cranberry tests - this module contains the unit tests for the remaining modules of the cranberry project.

๐Ÿ“ธ Demo

The demonstration shows how cranberry helps to write less code on the checking parameters implementation example for non-emptiness via usage of the @ NotEmpty annotation from the cranberry-statement module. This is one of opportunities which cranberry provides.

The demo of cranberry statement usage

๐ŸŽš Features

  • The api for the statements validation about not null values of the Object type;
  • The api for the statements validation about not empty values of the Map type, the Collection type, the Array and the String type;
  • The api for the statements validation about not blank values of the String type;
  • The api for the loggint method params;
  • The annotations for the injecting methods of this api into code during compilation.

To Do

  • For more information on an upcoming development, please read the todo list.

Changelog

  • For more information on a releases, a features and a changes, please read the changelog notes.

๐Ÿšฆ Getting Started

These instructions allow to get a copy of this project and run it on a local machine.

Prerequisites

Before using it, make sure that follows software are installed on the local machine:

Installing

Using Maven

In order to add cranberry to your project it is quite simple to:

1 - Add this dependency to classpath in pom:

<dependency>
    <groupId>io.github.ololx.cranberry</groupId>
    <artifactId>${module-name}</artifactId>
    <version>${version}</version>
</dependency>

Example of dependency for installing cranberry-muffin module with version 0.5.3 is presented bellow

<dependency>
    <groupId>io.github.ololx.cranberry</groupId>
    <artifactId>cranberry-muffin</artifactId>
    <version>0.5.3</version>
    <scope>provided</scope>
</dependency>

2 - Execute this with goal

clean install

Cloning

For the cloning this repository to a local machine, just use the follows link:

https://github.com/ololx/cranberry

Using

The simple example below presents the the checking of a parameters on not null value without the specific exception message returns and not blank value with the specific exception message returns.

 ...
//Add the checking statements for method params
public List<SomeDetail> findSomeDetailbyUidAndTypeCode(@NotNull Long uid, 
    @NotEmpty("The Type Code must be not empty") String typeCode) {
    return Collections.EMPTY_LIST;
}
...

The simple example below presents the the logging of a parameters of method with the specific message.

...
/**
 * The example of {@code @LogParam} annotation usage on {@code List<String> param}.
 * <p>
 * When this method is called, the parameters will be displayed in the log;
 * Messages in the log will label the format {@char "message param"} for each parameter.
 */
@LogParam(message = "Start execution with param =")
public static void runWithCustomMessage(List<String> param) {
    param.stream()
            .forEach(eachParam -> {
                System.out.println(eachParam);
            });
}
...

๐Ÿ›  Built With

  • Maven - Dependency Management.

๐ŸŽ‰ Contributing

If you want to contribute this project - you are welcome and have fun. Please visit the contributing section for details on this code of conduct, and the process for submitting pull requests.

๐Ÿ“ Code of Conduct

In order to ensure that all is welcoming, please review and abide by the code of conduct.

๐Ÿ—’ Versioning

For the versioning is used Semantic Versioning. For the versions available, see the changelog or the tags on this repository.

ยฉ๏ธ Authors

  • Alexander A. Kropotin - Initial work - ololx.

๐Ÿ” Licensing

This project is licensed under the Apache license version 2.0 - see the lisence document for details.

FOSSA Status

cranberry's People

Contributors

deepsourcebot avatar fossabot avatar ololx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cranberry's Issues

Fatal: super() could be on a first place

An error occurs when using an annotation from a statement package in a constructor. The error is related to the fact that the super() keyword must be the first one in the constructor.

TestNG is vulnerable to Path Traversal

A vulnerability was found in cbeust testng. It has been declared as critical. Affected by this vulnerability is the function testngXmlExistsInJar of the file testng-core/src/main/java/org/testng/JarFileUtils.java of the component XML File Parser. The manipulation leads to path traversal. The attack can be launched remotely. A patch is available in commit 9150736cd2c123a6a3b60e6193630859f9f0422b. It is recommended to apply a patch to fix this issue. The patch was pushed into the master branch but no releases have yet been made with the patch included.

https://github.com/ololx/cranberry/security/dependabot/3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.