Skip to content

Commit

Permalink
fixed package name
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsontom committed Oct 27, 2024
1 parent 90d6748 commit 972b2c6
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dsl/src/cli/java-server-jakarta-ws/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { JavaServerJakartaWSConfig, toPath } from "../java-gen-utils.js";
import { MEnumType, MInlineEnumType } from "../model.js";

export function generateEnum(t: MEnumType, artifactConfig: JavaServerJakartaWSConfig): Artifact {
const packageName = `${artifactConfig.rootPackageName}.dto`;
const packageName = `${artifactConfig.rootPackageName}.rest.dto`;

const node = new CompositeGeneratorNode()
node.append('// Generated by RSD - Do not modify',NL)
Expand Down
2 changes: 1 addition & 1 deletion dsl/src/cli/java-server-jakarta-ws/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function generateRecord(t: MResolvedRecordType, artifactConfig: JavaServe
if( t.resolved.unions.length === 1 ) {
return undefined;
}
const packageName = `${artifactConfig.rootPackageName}.dto`;
const packageName = `${artifactConfig.rootPackageName}.rest.dto`;

const importCollector = new JavaImportsCollector(packageName);
const fqn = importCollector.importType.bind(importCollector);
Expand Down
2 changes: 1 addition & 1 deletion dsl/src/cli/java-server-jakarta-ws/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function generateService(s: MResolvedService, artifactConfig: JavaRestCli
}

function generateServiceDTO(s: MResolvedService, o: MResolvedOperation, artifactConfig: JavaRestClientJDKGeneratorConfig): Artifact {
const packageName = `${artifactConfig.rootPackageName}.dto`;
const packageName = `${artifactConfig.rootPackageName}.rest.dto`;

const importCollector = new JavaImportsCollector(packageName);
const fqn = importCollector.importType.bind(importCollector);
Expand Down
2 changes: 1 addition & 1 deletion dsl/src/cli/java-server-jakarta-ws/union.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { generateInlineEnum } from "./enum.js";
import { toFirstUpper } from "../util.js";

export function generateUnion(t: MResolvedUnionType, artifactConfig: JavaServerJakartaWSConfig): Artifact {
const packageName = `${artifactConfig.rootPackageName}.dto`;
const packageName = `${artifactConfig.rootPackageName}.rest.dto!`;

const importCollector = new JavaImportsCollector(packageName);
const fqn = importCollector.importType.bind(importCollector);
Expand Down
59 changes: 59 additions & 0 deletions dsl/src/language/remote-service-persistence.langium
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
grammar RemoteServicePersistence

entry RSDPersistenceModel:
enums += PEnumType*
scalars += PScalarType*
entities += PEntity+
;

PScalarType:
doc = (SL_DOC_COMMENT|ML_DOC_COMMENT)?
'scalar' name=ID ';';

PBuiltinType returns string:
'boolean'|'short'|'int'|'string'|'float'|'double'|'long'|'local-date'|'local-date-time'|'zoned-date-time';

PEnumType:
doc = (SL_DOC_COMMENT|ML_DOC_COMMENT)?
'enum' name=ID '='
entries += PEnumEntry ( '|' entries += PEnumEntry )*
';';

PEnumEntry:
name=ID ('=' (value=INT|STRING))?
;

PEntity:
'entity' name=ID '{'

'}'
;

PValueType:
PScalarType | PEnumType
;

PValueTypeRef:
(builtin=PBuiltinType | refType=[PValueType:ID])
;

PValueProperty:
'val' name = ID ':' type=PValueTypeRef array?='[]'? optional?='?'? 'as' name=ID
;

PReferenceProperty:
('contains' name=ID ':' type=[PEntity:ID] array?='[]'? optional?='?'? )
|
('refs' name=ID ':' type=[PEntity:ID] optional?='?'?)
;

hidden terminal WS: /\s+/;
terminal ID: /[_a-zA-Z][\w_]*/;
terminal INT returns number: /[0-9]+/;
terminal STRING: /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/;

terminal ML_DOC_COMMENT: /<\*[\s\S]*?\*>/;
terminal SL_DOC_COMMENT: /<<[^\n\r]*/;

hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//;
hidden terminal SL_COMMENT: /\/\/[^\n\r]*/;

0 comments on commit 972b2c6

Please sign in to comment.