@langion/langion v1.0.5
Langion
Langion is a JSON format definition. Sometimes you need to integrate with a system that is written in other language. For example your server is written in Java and your client is written in TypeScript. So when someone will change something on server, TypeScript will not be able no highlight errors because server is written in Java. But the information about types is close, just written in different language. What you need is to extract types from another language and generate types in you languages. The Langion format defines common information to describe types in different language. Using this format you can generate any code you want.
How to run on Java
In order to generate Langion you need to add langion-maven-plugin to your pom.xml
<plugin>
<groupId>com.github.langion</groupId>
<artifactId>langion-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<configuration>
<outFileName>{path to output file}</outFileName>
<srcBaseJavaFolders>{absolute path to src folder}</srcBaseJavaFolders>
<pattern>
<pattern>{Pattern of canonical paths}</pattern>
</pattern>
</configuration>
<id>java-to-json</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>Form
Kind
Enum - All the entities that has Langion
| Key | Value |
|---|---|
| Annotation | Annotation |
| Enum | Enum |
| Field | Field |
| Generic | Generic |
| Interface | Interface |
| Langion | Langion |
| Method | Method |
| Class | Class |
| Modifier | Modifier |
| Package | Package |
| Type | Type |
| Value | Value |
| Variable | Variable |
| Wildcard | Wildcard |
Modifiers
Enum - Modifiers that applied to fields
| Key | Value |
|---|---|
| Private | Private |
| Protected | Protected |
| Public | Public |
Entity
| Key | Type | Comment |
|---|---|---|
| Canonical | string | |
| Comment | string | |
| Kind | Kind | |
| Name | string | |
| Path | string |
AnnotationEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Items | Map<string, ValueEntity> |
ArgumentEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Position | number | |
| Type | TypeEntity | |
| Annotations | Map<string, AnnotationEntity> |
ClassEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Extends | TypeEntity | |
| Modifiers | ModifierEntity | |
| Annotations | Map<string, ValueEntity> | |
| Fields | Map<string, FieldEntity> | |
| Implements | Map<string, TypeEntity> | |
| Methods | Map<string, Array<MethodEntity>> | |
| Constructors | Array<MethodEntity> | |
| Variables | Map<string, VariableEntity> |
EnumEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Extends | TypeEntity | |
| Modifiers | ModifierEntity | |
| Annotations | Map<string, ValueEntity> | |
| Implements | Map<string, TypeEntity> | |
| Variables | Map<string, VariableEntity> | |
| Items | Map<string, string> |
FieldEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Modifiers | ModifierEntity | |
| Type | TypeEntity | |
| Annotations | Map<string, AnnotationEntity> |
GenericEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| IsParameter | boolean | |
| Position | number | |
| Type | TypeEntity | |
| Variable | VariableEntity | |
| Wildcard | WildcardEntity |
InterfaceEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Modifiers | ModifierEntity | |
| Annotations | Map<string, AnnotationEntity> | |
| Extends | Map<string, TypeEntity> | |
| Methods | Map<string, Array<MethodEntity>> | |
| Variables | Map<string, VariableEntity> |
Langion
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Modules | Map<string, ModuleEntity> | |
| Version | string |
InterfaceEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Modifier | ModifierEntity | |
| Returns | TypeEntity | |
| Annotations | Map<string, AnnotationEntity> | |
| Arguments | Map<string, ArgumentEntity> | |
| Variables | Map<string, VariableEntity> |
ModifierEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Items | Map<Modifiers, Modifiers> |
ModuleEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Exports | Map<string, Entity> | |
| Modules | Map<string, ModuleEntity> |
TypeEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| IsArray | boolean | |
| IsParameter | boolean | |
| Generics | Map<string, GenericEntity> |
ValueEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Content | any | |
| Type | TypeEntity |
VariableEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Position | number |
WildcardEntity
Extends: Entity
| Key | Type | Comment |
|---|---|---|
| Lower | Map<string, GenericEntity> | |
| Upper | Map<string, GenericEntity> |