-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is more a clarification request than an issue #4
Comments
Hi |
Hi You was right, new converter was needed Property is a mean to collect java field and methods which have impact on TypeScript field. In jackson/fasterxml You can make crazy things with mapping java field and getters/setters to JSON field I'm new to angular2-jsonapi I don't know if you need to generate only model or some controller proxies are also required, please feel free to develop in branch "version-1.2.4-angular2-jsonapi" I would like to help You achieve proper implementation. You can reach me on skype [email protected] |
Thank you very much, I'm going to give it a try... And I will add you on skype ;) |
How can I add annotation to the ts files?
I need to use an Angular library (angular2-jsonapi) that needs class and fileds to be annotated with a specific annotation. Like the following:
`import { JsonApiModelConfig, JsonApiModel, Attribute, HasMany, BelongsTo } from 'angular2-jsonapi';
@JsonApiModelConfig({
type: 'examples',
})
export class Example extends JsonApiModel {
@Attribute()
id: string;
@Attribute()
title: string;`
I was thinking to add a special annotation in Java and get what I want in ts. But not clear to me how to proceed.
First of all : Is possible to accomplish that with your library?
Do we need to implement a special Converter, right?
I'm thinking to put some extra logic in a custom: "ModelClassesAbstractConverter"
and in the method: "getClassProperties" check if my JavaClass contain a special(custom) annotation @MyAnnotation like this:
if (javaClass.isAnnotationPresent(MyAnnotation.class)) { System.out.println("Found annotation in the class!"); }
if (field.isAnnotationPresent(MyAnnotation.class)) { System.out.println("Found annoatation in the field") }
But I don't see some special setting in the Property class that can be used later on to add the annotation into the ts file...
Can you please provide an example?
Thank you in advance.
The text was updated successfully, but these errors were encountered: