Manifold :: Bootstrap Plugin

Manifold supplements Java with useful features like Type-safe Metaprogramming, Structural Typing, and Extension Methods. Simply add Manifold to your project and begin taking advantage of it.

License

License

Categories

Categories

Manifold Development Tools Development Libraries
GroupId

GroupId

systems.manifold
ArtifactId

ArtifactId

manifold-bootstrap-plugin
Last Version

Last Version

2019.1.10
Release Date

Release Date

Type

Type

jar
Description

Description

Manifold :: Bootstrap Plugin
Manifold supplements Java with useful features like Type-safe Metaprogramming, Structural Typing, and Extension Methods. Simply add Manifold to your project and begin taking advantage of it.
Project URL

Project URL

http://manifold.systems

Download manifold-bootstrap-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/systems.manifold/manifold-bootstrap-plugin/ -->
<dependency>
    <groupId>systems.manifold</groupId>
    <artifactId>manifold-bootstrap-plugin</artifactId>
    <version>2019.1.10</version>
</dependency>
// https://jarcasting.com/artifacts/systems.manifold/manifold-bootstrap-plugin/
implementation 'systems.manifold:manifold-bootstrap-plugin:2019.1.10'
// https://jarcasting.com/artifacts/systems.manifold/manifold-bootstrap-plugin/
implementation ("systems.manifold:manifold-bootstrap-plugin:2019.1.10")
'systems.manifold:manifold-bootstrap-plugin:jar:2019.1.10'
<dependency org="systems.manifold" name="manifold-bootstrap-plugin" rev="2019.1.10">
  <artifact name="manifold-bootstrap-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='systems.manifold', module='manifold-bootstrap-plugin', version='2019.1.10')
)
libraryDependencies += "systems.manifold" % "manifold-bootstrap-plugin" % "2019.1.10"
[systems.manifold/manifold-bootstrap-plugin "2019.1.10"]

Dependencies

compile (1)

Group / Artifact Type Version
systems.manifold : manifold-util jar 2019.1.10

Project Modules

There are no modules declared in this project.

What is Manifold?

Manifold plugs into Java to supplement it with powerful features, including:

All fully supported in Java 8 - 15 with comprehensive IDE support in IntelliJ IDEA and Android Studio. Simply add Manifold to your existing project and begin taking advantage of it.

New!

What can you do with Manifold?

Meta-programming

Use the framework to gain direct, type-safe access to any type of resource, such as GraphQL, JSON, XML, YAML, CSV, and even other languages such as JavaScript. Remove the code gen step in your build process.    Check it out!

GraphQL: Use types defined in .graphql files directly, no code gen steps! Make GraphQL changes and immediately use them with code completion.

var query = MovieQuery.builder(Action).build();
var result = query.request("http://example.com/graphql").post();
var actionMovies = result.getMovies();
for (var movie : actionMovies) {
  out.println(
    "Title: " + movie.getTitle() + "\n" +
    "Genre: " + movie.getGenre() + "\n" +
    "Year: " + movie.getReleaseDate().getYear() + "\n");
}

JSON: Use .json schema files directly and type-safely, no code gen steps! Find usages of .json properties in your Java code.

// From User.json
User user = User.builder("myid", "mypassword", "Scott")
  .withGender(male)
  .withDob(LocalDate.of(1987, 6, 15))
  .build();
User.request("http://api.example.com/users").postOne(user);

Extension Methods

Add your own methods to existing Java classes, even String, List, and File. Eliminate boilerplate code.    Check it out!

String greeting = "hello";
greeting.myMethod(); // Add your own methods to String!

Operator Overloading

Implement operator methods on any type to directly support arithmetic, relational, and unit operators.

// BigDecimal expressions
if (bigDec1 > bigDec2) {
  BigDecimal result = bigDec1 + bigDec2;
  ...
}
// Implement operators for any type
MyType value = myType1 + myType2;

Unit Expressions

Unit or binding operations are unique to the Manifold framework. They provide a powerfully concise syntax and can be applied to a wide range of applications.

import static manifold.science.util.UnitConstants.*; // kg, m, s, ft, etc
...
Length distance = 100 mph * 3 hr;
Force f = 5.2 kg m/s/s; // same as 5.2 N
Mass infant = 9 lb + 8.71 oz;

Ranges

Easily work with the Range API using unit expressions. Simply import the RangeFun constants to create ranges.

// imports the `to`, `step`, and other "binding" constants
import static manifold.collections.api.range.RangeFun.*;
...
for (int i: 1 to 5) {
  out.println(i);
}

for (Mass m: 0kg to 10kg step 22r unit g) {
  out.println(m);
}

Science

Use the manifold-science framework to type-safely incorporate units and precise measurements into your applications.

import static manifold.science.util.UnitConstants.*; // kg, m, s, ft, etc.
...
Velocity rate = 65mph;
Time time = 1min + 3.7sec;
Length distance = rate * time;

Preprocessor

Use familiar directives such as #define and #if to conditionally compile your Java projects. The preprocessor offers a simple and convenient way to support multiple build targets with a single codebase.    Check it out!

#if JAVA_8_OR_LATER
  @Override
  public void setTime(LocalDateTime time) {...}
#else
  @Override
  public void setTime(Calendar time) {...}
#endif

Structural Typing

Unify disparate APIs. Bridge software components you do not control. Access maps through type-safe interfaces.    Check it out!

Map<String, Object> map = new HashMap<>();
MyThingInterface thing = (MyThingInterface) map; // O_o
thing.setFoo(new Foo());
Foo foo = thing.getFoo();
out.println(thing.getClass()); // prints "java.util.HashMap"

Type-safe Reflection

Access private features with @Jailbreak to avoid the drudgery and vulnerability of Java reflection.    Check it out!

@Jailbreak Foo foo = new Foo();
// Direct, *type-safe* access to *all* foo's members
foo.privateMethod(x, y, z);
foo.privateField = value;

Checked Exception Handling

You now have an option to make checked exceptions behave like unchecked exceptions! No more unintended exception swallowing. No more try/catch/wrap/rethrow boilerplate!

List<String> strings = ...;
List<URL> urls = list
  .map(URL::new) // No need to handle the MalformedURLException!
  .collect(Collectors.toList());

String Templates

Embed variables and expressions in String literals, no more clunky string concat!    Check it out!

int hour = 15;
// Simple variable access with '$'
String result = "The hour is $hour"; // Yes!!!
// Use expressions with '${}'
result = "It is ${hour > 12 ? hour-12 : hour} o'clock";

A Java Template Engine

Author template files with the full expressive power of Java, use your templates directly in your code as types. Supports type-safe inclusion of other templates, shared layouts, and more.    Check it out!

List<User> users = ...;
String content = abc.example.UserSample.render(users);

A template file abc/example/UserSample.html.mtl

<%@ import java.util.List %>
<%@ import com.example.User %>
<%@ params(List<User> users) %>
<html lang="en">
<body>
<% users.stream()
   .filter(user -> user.getDateOfBirth() != null)
   .forEach(user -> { %>
    User: ${user.getName()} <br>
    DOB: ${user.getDateOfBirth()} <br>
<% }); %>
</body>
</html>

IDE Support

Use the Manifold plugin to fully leverage Manifold with IntelliJ IDEA and Android Studio. The plugin provides comprehensive support for Manifold including code completion, navigation, usage searching, refactoring, incremental compilation, hotswap debugging, full-featured template editing, integrated preprocessor, and more.

manifold ij plugin

Projects

The Manifold project consists of the core Manifold framework and a collection of sub-projects implementing SPIs provided by the core framework. Each project consists of one or more dependencies you can easily add to your project:

Manifold : Core

Manifold : Java Extensions

Manifold : GraphQL
Manifold : JSON
Manifold : XML
Manifold : YAML
Manifold : CSV
Manifold : Properties
Manifold : Image
Manifold : Dark Java
Manifold : JavaScript

Manifold : Java Templates

Manifold : String Interpolation
Manifold : (Un)checked Exceptions

Manifold : Preprocessor

Manifold : Science

Manifold : Collections
Manifold : I/0
Manifold : Text

Experiment with sample projects:

Forum

Join our Slack Group to start a discussion, ask questions, provide feedback, etc. Someone is usually there to help.

Learn More


systems.manifold

Manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, a Preprocessor, and a lot more.

Versions

Version
2019.1.10
2019.1.9
2019.1.8
2019.1.7
2019.1.5
2019.1.4
2019.1.3
2019.1.2
2019.1.0-gw
2019.1.0-ea
0.71-alpha
0.70-alpha
0.69-alpha
0.68-alpha
0.67-alpha
0.65-alpha
0.64-alpha
0.63-alpha
0.62-alpha
0.61-alpha
0.60-alpha
0.59-alpha
0.58-alpha
0.57-alpha
0.56-alpha
0.55-alpha
0.54-alpha
0.53-alpha
0.52-alpha
0.51-alpha
0.50-alpha
0.49-alpha
0.48-alpha
0.47-alpha
0.46.alpha
0.45-alpha
0.44-alpha
0.43-alpha
0.42-alpha
0.41-alpha
0.40-alpha
0.39-alpha
0.38-alpha
0.37-alpha
0.36-alpha
0.34-alpha
0.33-alpha
0.32-alpha
0.31-alpha
0.30-alpha
0.29-alpha
0.28-alpha
0.27-alpha
0.26-alpha
0.25-alpha
0.24-alpha
0.23-alpha
0.22-alpha
0.21-alpha
0.20-alpha
0.19-alpha
0.12-alpha
0.11-alpha
0.10-alpha
0.9-alpha
0.8-alpha