gen-jhipster
Version:
VHipster - Spring Boot + Angular/React/Vue in one handy generator
87 lines (86 loc) • 3.6 kB
TypeScript
/**
* Copyright 2013-2026 the original author or authors from the JHipster project.
*
* This file is part of the JHipster project, see https://www.jhipster.tech/
* for more information.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type AbstractJDLOption from './abstract-jdl-option.ts';
import type JDLApplication from './jdl-application.ts';
import type JDLDeployment from './jdl-deployment.ts';
import type JDLEntity from './jdl-entity.ts';
import type JDLEnum from './jdl-enum.ts';
import JDLEnums from './jdl-enums.ts';
import JDLOptions from './jdl-options.ts';
import type JDLRelationship from './jdl-relationship.ts';
import JDLRelationships from './jdl-relationships.ts';
/**
* The JDL object class, containing applications, entities etc.
*/
export default class JDLObject {
applications: Record<string, JDLApplication>;
deployments: Record<string, JDLDeployment>;
entities: Record<string, JDLEntity>;
enums: JDLEnums;
relationships: JDLRelationships;
options: JDLOptions;
constructor();
getOptions(): AbstractJDLOption[];
/**
* Adds or replaces an application.
* @param application the application.
*/
addApplication(application: JDLApplication): void;
getApplicationQuantity(): number;
getApplication(applicationName: string): JDLApplication | undefined;
getApplications(): JDLApplication[];
forEachApplication(passedFunction: (app: JDLApplication) => void | undefined | null): void;
/**
* Adds or replaces a deployment.
* @param deployment the deployment.
*/
addDeployment(deployment: JDLDeployment): void;
getDeploymentQuantity(): number;
forEachDeployment(passedFunction: (deployment: JDLDeployment, index: number, array: string[]) => void): void;
/**
* Adds or replaces an entity.
* @param entity the entity to add.
*/
addEntity(entity: JDLEntity): void;
getEntity(entityName: string): JDLEntity;
getEntities(): JDLEntity[];
getEntityQuantity(): number;
getEntityNames(): string[];
forEachEntity(passedFunction: (entity: JDLEntity, index: number, entityNames: string[]) => void): void;
/**
* Adds or replaces an enum.
* @param enumToAdd the enum to add.
*/
addEnum(enumToAdd: JDLEnum): void;
hasEnum(enumName: string): boolean;
getEnum(enumName: string): JDLEnum | undefined;
getEnumQuantity(): number;
forEachEnum(passedFunction: (jdlEnum: JDLEnum) => void): void;
addRelationship(relationship: JDLRelationship): void;
getRelationshipQuantity(applicationName?: string): number;
forEachRelationship(passedFunction: (relationship: JDLRelationship) => void): void;
getRelationships(): JDLRelationship[];
addOption(option: AbstractJDLOption): void;
getOptionsForName(optionName: string): AbstractJDLOption[];
forEachOption(passedFunction: (option: AbstractJDLOption) => void): void;
hasOption(optionName: string): boolean;
isEntityInMicroservice(entityName: string): boolean;
getOptionQuantity(): number;
toString(): string;
}