Skip to content

karlbennett/smt-transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 

Repository files navigation

smt-transform

This is the API that is implemented by all the SMT transformation libraries. It doesn't contain any stream processing logic its self.

How ever it does contain some helper classes.

ApplyableTransformation

This is a very simple abstract implementation of the Transformation interface that allows the Applier half of the Transformation to be set as a constructor dependency.

CompoundTransformations

A Transformations implementation that is used to relate a collection of Transformation names to a single Applier instance.

Transformations transformations = new CompoundTransformations(asList("one", "two", "three"),
    new Applier() {

        @Override
        public String apply(String string) {

            return "applied";
        }
    }
);

transformations.get("one").apply("one"); // "applied"
transformations.get("two").apply("two"); // "applied"
transformations.get("three").apply("three"); // "applied"
transformations.get("four").apply("four"); // "four"

IndividualTransformations

This implementation of the Transformations interface can be populated with any Iterable object. This means it can be populated from another Transformations instance.

new IndividualTransformations(
    new IndividualTransformations(
        asList(transformationOne, transformationTwo, transformationThree)
    )
);

NullTransformation

This is just a null implementation of the Transformation interface that has the empty string as it's name and an apply(String) method that makes no change to the string passed to it.

WrappedTransformer

This Transformer implementation wraps a Transformer and Transformations together to simplify reapplying the two over different texts. It also contains some helper methods for applying the Transformations to Strings.

About

A simple library for applying transformations to an input stream.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages