manifold

所属分类:Python编程
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2023-06-27 03:30:10
上 传 者sh-1993
说明:  Manifold是一个Java编译器插件,其功能包括元编程、属性、扩展方法、运算符Ove...
(Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.)

文件列表:
.circleci/ (0, 2023-12-31)
.circleci/config.yml (1360, 2023-12-31)
.circleci/deploy_snapshot.sh (165, 2023-12-31)
LICENSE (11357, 2023-12-31)
authors.txt (52, 2023-12-31)
docs/ (0, 2023-12-31)
docs/.ruby-gemset (13, 2023-12-31)
docs/.ruby-version (10, 2023-12-31)
docs/CNAME (16, 2023-12-31)
docs/_config.yml (129, 2023-12-31)
docs/_layouts/ (0, 2023-12-31)
docs/_layouts/default.html (11461, 2023-12-31)
docs/_layouts/docs_layout.html (1876, 2023-12-31)
docs/_layouts/projects_layout.md (2910, 2023-12-31)
docs/android.md (5394, 2023-12-31)
docs/articles/ (0, 2023-12-31)
docs/articles/JavaSymbolAccessRules.md (1629, 2023-12-31)
docs/articles/articles.md (15140, 2023-12-31)
docs/articles/checked_exceptions.md (3802, 2023-12-31)
docs/articles/class_objects_arent_oop.md (3877, 2023-12-31)
docs/articles/graphql.md (15085, 2023-12-31)
docs/articles/jailbreak.md (3973, 2023-12-31)
docs/articles/manifold_alien_tech.md (10022, 2023-12-31)
docs/articles/manifold_series_1.md (11722, 2023-12-31)
docs/articles/manifold_series_2.md (9797, 2023-12-31)
docs/articles/mars_climate_orbiter.md (6350, 2023-12-31)
docs/articles/operator_overloading.md (11616, 2023-12-31)
docs/articles/preprocessor.md (10243, 2023-12-31)
docs/articles/properties.md (3680, 2023-12-31)
docs/articles/reflection.md (4803, 2023-12-31)
docs/articles/unchecked.md (4201, 2023-12-31)
docs/articles/wakeup.md (7934, 2023-12-31)
docs/branding/ (0, 2023-12-31)
... ...


![latest](https://img.shields.io/badge/latest-v2023.1.33-darkgreen.svg) [![slack](https://img.shields.io/badge/slack-manifold-blue.svg?logo=slack)](https://join.slack.com/t/manifold-group/shared_invite/zt-e0bq8xtu-93ASQa~a8qe0KDhOoD6Bgg) [![GitHub Repo stars](https://img.shields.io/github/stars/manifold-systems/manifold?logo=github&color=red)](https://github.com/manifold-systems/manifold) --- ## What is Manifold? Manifold is a Java compiler plugin. It supplements Java with: * Direct, _type-safe_ access to: * [SQL](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql) _**(New!)**_ * [GraphQL](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql) * [JSON & JSON Schema](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json), [YAML](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-yaml), [XML](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-xml) * [CSV](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-csv) * [JavaScript](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-js) * etc. * [Extension methods](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext) * [Delegation](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-delegation) * [Properties](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-props) * [Tuple expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-tuple) * [Operator overloading](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#operator-overloading) * [Unit expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#unit-expressions) * [A *Java* template engine](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-templates) * [A preprocessor](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-preprocessor) * ...and more All fully supported in JDK LTS releases 8 - 21 + latest with comprehensive IDE support in **IntelliJ IDEA** and **Android Studio**. Manifold consists of a set of modules, one for each feature. Simply add the Manifold dependencies of your choosing to your existing project and begin taking advantage of them. ># _**What's New...**_ > >### [Type-safe SQL](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql/readme.md) > Manifold SQL harnesses your database to let you write native, _type-safe_ SQL _directly_ in your Java code. >- Java interfaces are instantly available as you type native SQL of any complexity in your Java code or in SQL files >- No ORM, No DSL, No wiring, and No code generation build steps >

> ![img_3.png](./docs/images/img_3.png) ## What can you do with Manifold? ### [Meta-programming](https://github.com/manifold-systems/manifold/tree/master/manifold-core-parent/manifold) Use the framework to gain direct, type-safe access to *any* type of resource, such as [**SQL**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql), [**JSON**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json), [**GraphQL**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql), [**XML**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-xml), [**YAML**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-yaml), [**CSV**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-csv), and even other languages such as [**JavaScript**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-js). Remove the code gen step in your build process. [ **** Check it out!](http://manifold.systems/images/graphql.mp4) [**SQL:**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql) Use _native_ SQL of any complexity _directly_ and _type-safely_ from Java. ```java Language english = "[.sql/]select * from Language where name = 'English'".fetchOne(); Film film = Film.builder("My Movie", english) .withDescription("Nice movie") .withReleaseYear(2023) .build(); MyDatabase.commit(); ``` [**GraphQL:**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql) Use types defined in .graphql files *directly*, no code gen steps! Make GraphQL changes and immediately use them with code completion. ```java var query = MovieQuery.builder(Action).build(); var result = query.request("http://com.example/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:**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json) Use .json schema files directly and type-safely, no code gen steps! Find usages of .json properties in your Java code. ```java // 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](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext) Add your own methods to existing Java classes, even *String*, *List*, and *File*. Eliminate boilerplate code. [ **** Check it out!](http://manifold.systems/images/ExtensionMethod.mp4) ```java String greeting = "hello"; greeting.myMethod(); // Add your own methods to String! ``` ### [Delegation](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-delegation) Favor composition over inheritance. Use `@link` and `@part` for automatic interface implementation forwarding and delegation. > ```java > class MyClass implements MyInterface { > @link MyInterface myInterface; // transfers calls on MyInterface to myInterface > > public MyClass(MyInterface myInterface) { > this.myInterface = myInterface; // dynamically configure behavior > } > > // No need to implement MyInterface here, but you can override myInterface as needed > } > ``` ### [Properties](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-props) Eliminate boilerplate getter/setter code, improve your overall dev experience with properties. ```java public interface Book { @var String title; // no more boilerplate code! } // refer to it directly by name book.title = "Daisy"; // calls setter String name = book.title; // calls getter book.title += " chain"; // calls getter & setter ``` Additionally, the feature automatically _**infers**_ properties, both from your existing source files and from compiled classes your project uses. Reduce property use from this: ```java Actor person = result.getMovie().getLeadingRole().getActor(); Likes likes = person.getLikes(); likes.setCount(likes.getCount() + 1); ``` to this: ```java result.movie.leadingRole.actor.likes.count++; ``` ### [Operator Overloading](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#operator-overloading) Implement *operator* methods on any type to directly support arithmetic, relational, index, and unit operators. ```java // BigDecimal expressions if (bigDec1 > bigDec2) { BigDecimal result = bigDec1 + bigDec2; ... } // Implement operators for any type MyType value = myType1 + myType2; ``` ### [Tuple expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-tuple) Tuple expressions provide concise syntax to group named data items in a lightweight structure. ```java var t = (name: "Bob", age: "35"); System.out.println("Name: " + t.name + " Age: " + t.age); var t = (person.name, person.age); System.out.println("Name: " + t.name + " Age: " + t.age); ``` You can also use tuples with new [`auto` type inference](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#type-inference-with-auto) to enable multiple return values from a method. ### [Unit Expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#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. ```java 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](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-collections#ranges) Easily work with the *Range* API using [unit expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#unit-expressions). Simply import the *RangeFun* constants to create ranges. ```java // 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](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-science) Use the [manifold-science](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-science) framework to type-safely incorporate units and precise measurements into your applications. ```java import static manifold.science.util.UnitConstants.*; // kg, m, s, ft, etc. ... Velocity rate = 65mph; Time time = 1min + 3.7sec; Length distance = rate * time; ``` ### [Preprocessor](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-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!](http://manifold.systems/images/preprocessor.mp4) ```java #if JAVA_8_OR_LATER @Override public void setTime(LocalDateTime time) {...} #else @Override public void setTime(Calendar time) {...} #endif ``` ### [Structural Typing](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#structural-interfaces-via-structural) Unify disparate APIs. Bridge software components you do not control. Access maps through type-safe interfaces. [ **** Check it out!](http://manifold.systems/images/structural%20typing.mp4) ```java Map 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](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#type-safe-reflection-via-jailbreak) Access private features with @Jailbreak to avoid the drudgery and vulnerability of Java reflection. [ **** Check it out!](http://manifold.systems/images/jailbreak.mp4) ```java @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](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-exceptions) 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! ```java List strings = ...; List urls = strings.stream() .map(URL::new) // No need to handle the MalformedURLException! .collect(Collectors.toList()); ``` ### [String Templates](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-strings) Inline variables and expressions in String literals, no more clunky string concat! [ **** Check it out!](http://manifold.systems/images/string_interpolation.mp4) ```java 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](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-templates) 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!](http://manifold.systems/images/mantl.mp4) ```java List users = ...; String content = abc.example.UserSample.render(users); ``` A template file *abc/example/UserSample.html.mtl* ```html <%@ import java.util.List %> <%@ import com.example.User %> <%@ params(List users) %> <% for(User user: users) { %> <% if(user.getDateOfBirth() != null) { %> User: ${user.getName()}
DOB: ${user.getDateOfBirth()}
<% } %> <% } %> ``` ## [IDE Support](https://github.com/manifold-systems/manifold) Use the [Manifold plugin](https://plugins.jetbrains.com/plugin/10057-manifold) 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

[Get the plugin from JetBrains Marketplace](https://plugins.jetbrains.com/plugin/10057-manifold) ## [Projects](https://github.com/manifold-systems/manifold) 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_](https://github.com/manifold-systems/manifold/tree/master/manifold-core-parent/manifold)
[Manifold : _Extensions_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext)
[Manifold : _Delegation_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-delegation)
[Manifold : _Properties_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-props)
[Manifold : _Tuples_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-tuple)
[Manifold : _SQL_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql)
[Manifold : _GraphQL_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql)
[Manifold : _JSON_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json)
[Manifold : _XML_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-xml)
[Manifold : _YAML_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-yaml)
[Manifold : _CSV_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-csv)
[Manifold : _Property Files_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-properties)
[Manifold : _Image_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-image)
[Manifold : _Dark Java_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-darkj)
[Manifold : _JavaScript_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-js)
[Manifold : _Java Templates_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-templates)
[Manifold : _String Interpolation_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-strings)
[Manifold : _(Un)checked Exceptions_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-exceptions)
[Manifold : _Preprocessor_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-preprocessor)
[Manifold : _Science_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-science)
[Manifold : _Collections_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-collections)
[Manifold : _I/0_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-io)
[Manifold : _Text_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-text)
>Experiment with sample projects:
>* [Manifold : _Sample App_](https://github.com/manifold-systems/manifold-sample-project)
>* [Manifold : _Sample SQL App_](https://github.com/manifold-systems/manifold-sql-sample-app)
>* [Manifold : _Sample GraphQL App_](https://github.com/manifold-systems/manifold-sample-graphql-app)
>* [Manifold : _Sample REST API App_](https://github.com/manifold-systems/manifold-sample-rest-api)
>* [Manifold : _Sample Web App_](https://github.com/manifold-systems/manifold-sample-web-app) >* [Manifold : _Gradle Example Project_](https://github.com/manifold-systems/manifold-simple-gradle-project) >* [Manifold : _Sample Kotlin App_](https://github.com/manifold-systems/manifold-sample-kotlin-app) ## Platforms Manifold supports: * Java SE (8 - 21) * [Android](http://manifold.systems/android.html) * [Kotlin](http://manifold.systems/kotlin.html) (limited) Comprehensive IDE support is also available for IntelliJ IDEA and Android Studio. ## [Chat](https://join.slack.com/t/manifold-group/shared_invite/zt-e0bq8xtu-93ASQa~a8qe0KDhOoD6Bgg) Join our [Slack Group](https://join.slack.com/t/manifold-group/shared_invite/zt-e0bq8xtu-93ASQa~a8qe0KDhOoD6Bgg) to start a discussion, ask questions, provide feedback, etc. Someone is usually there to help.

近期下载者

相关文件


收藏者