-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
9,335 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.bsc.processor</groupId> | ||
<artifactId>java2ts-processor-parent</artifactId> | ||
<version>1.2.0</version> | ||
</parent> | ||
<artifactId>java2ts-processor-core</artifactId> | ||
<name>java2ts-processor::core - ${project.version}</name> | ||
|
||
<dependencies> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.bsc.processor</groupId> | ||
<artifactId>java2ts-processor-parent</artifactId> | ||
<version>1.3.0</version> | ||
</parent> | ||
<artifactId>java2ts-processor-core</artifactId> | ||
<name>java2ts-processor::core</name> | ||
<build> | ||
<plugins> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</dependencies> | ||
</project> |
38 changes: 38 additions & 0 deletions
38
core/src/main/java/org/bsc/java2typescript/TSNamespace.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.bsc.java2typescript; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
import static java.lang.String.format; | ||
|
||
public class TSNamespace { | ||
|
||
private final String name; | ||
|
||
private final Set<TSType> types; | ||
|
||
private TSNamespace(String name, Set<TSType> types) { | ||
this.name = name; | ||
this.types = Collections.unmodifiableSet(types); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Set<TSType> getTypes() { | ||
return types; | ||
} | ||
|
||
public static TSNamespace of( String name, Set<TSType> types ) { | ||
return new TSNamespace( name, types ); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return format( "TSNamespace: { name: '%s', types: [%s] }", | ||
name, getTypes().stream() | ||
.map( TSType::toString ).collect(Collectors.joining(",\n")) ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Project: java2typescript - https://github.com/bsorrentino/java2typescript | ||
* | ||
* Author: bsorrentino | ||
* | ||
* TYPESCRIPT DEFINITIONS | ||
* | ||
*/ | ||
|
||
type int = number; | ||
type long = number; | ||
type float = number; | ||
type double = number; | ||
type byte = number; | ||
type char = string; | ||
|
||
type chararray = [byte]; | ||
type bytearray = [char]; | ||
|
||
declare namespace java.lang { | ||
|
||
interface Class<T> {} | ||
interface AutoCloseable {} | ||
interface Cloneable {} | ||
|
||
type Object = any; | ||
} | ||
|
||
declare namespace java.util { | ||
|
||
interface RandomAccess {} | ||
} | ||
|
||
declare namespace java.io { | ||
|
||
interface Closeable {} | ||
interface Serializable {} | ||
} | ||
|
||
// | ||
// Rhino | ||
// | ||
|
||
declare const Packages:any; | ||
|
||
declare function print( ...args: any[] ):void | ||
|
||
declare function load( module:string ):void | ||
|
||
// | ||
// Generated declarations | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.