forked from redhat-developer/quarkus-ls
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes redhat-developer#629 Signed-off-by: azerr <azerr@redhat.com>
- Loading branch information
1 parent
f7ef2e8
commit 4377583
Showing
31 changed files
with
1,433 additions
and
196 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...test/projects/maven/qute-quickstart/src/main/java/org/acme/qute/ItemWithTemplateData.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,27 @@ | ||
package org.acme.qute; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import io.quarkus.qute.TemplateData; | ||
|
||
@TemplateData(target = BigDecimal.class) | ||
@TemplateData(ignoreSuperclasses = true) | ||
public class ItemWithTemplateData { | ||
|
||
public final String name; | ||
|
||
public final BigDecimal price; | ||
|
||
public ItemWithTemplateData(BigDecimal price, String name) { | ||
this.price = price; | ||
this.name = name; | ||
} | ||
|
||
public Item[] getDerivedItems() { | ||
return null; | ||
} | ||
|
||
public static BigDecimal staticMethod(Item item) { | ||
return item.price.multiply(new BigDecimal("0.9")); | ||
} | ||
} |
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
52 changes: 52 additions & 0 deletions
52
...edhat.qute.jdt/src/main/java/com/redhat/qute/commons/RegisterForReflectionAnnotation.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,52 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package com.redhat.qute.commons; | ||
|
||
/** | ||
* '@io.quarkus.runtime.annotations.RegisterForReflection' annotation | ||
* | ||
* This annotation that can be used to force a class to be registered for | ||
* reflection in native image mode | ||
*/ | ||
public class RegisterForReflectionAnnotation { | ||
|
||
public RegisterForReflectionAnnotation() { | ||
setMethods(true); | ||
setFields(true); | ||
} | ||
|
||
/** | ||
* If the methods should be registered | ||
*/ | ||
private boolean methods; | ||
|
||
/** | ||
* If the fields should be registered | ||
*/ | ||
private boolean fields; | ||
|
||
public boolean isMethods() { | ||
return methods; | ||
} | ||
|
||
public void setMethods(boolean methods) { | ||
this.methods = methods; | ||
} | ||
|
||
public boolean isFields() { | ||
return fields; | ||
} | ||
|
||
public void setFields(boolean fields) { | ||
this.fields = fields; | ||
} | ||
} |
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
43 changes: 43 additions & 0 deletions
43
...jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/commons/TemplateDataAnnotation.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,43 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package com.redhat.qute.commons; | ||
|
||
import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; | ||
|
||
/** | ||
* '@io.quarkus.qute.TemplateData' annotation. | ||
* | ||
* @author Angelo ZERR | ||
* | ||
*/ | ||
public class TemplateDataAnnotation { | ||
|
||
/** | ||
* If set to true do not automatically analyze superclasses. | ||
*/ | ||
private Boolean ignoreSuperclasses; | ||
|
||
public boolean isIgnoreSuperclasses() { | ||
return ignoreSuperclasses != null && ignoreSuperclasses.booleanValue(); | ||
} | ||
|
||
public void setIgnoreSuperclasses(Boolean ignoreSuperclasses) { | ||
this.ignoreSuperclasses = ignoreSuperclasses; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
ToStringBuilder b = new ToStringBuilder(this); | ||
b.add("ignoreSuperclasses", this.isIgnoreSuperclasses()); | ||
return b.toString(); | ||
} | ||
} |
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
Oops, something went wrong.