Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
ContextProperty -> DataElementTemplateProperty
Browse files Browse the repository at this point in the history
And add preliminary PersistenceHandlerTemplateProperty

Signed-off-by: Daniel Bluhm <bluhmdj@ornl.gov>
  • Loading branch information
dbluhm committed Jun 4, 2020
1 parent f41186e commit 049ed7c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
Expand Up @@ -267,10 +267,10 @@ private void writeClass(final String interfaceName, final List<Field> fields) th

// Prepare context of template
final VelocityContext context = new VelocityContext();
context.put(ContextProperty.PACKAGE.key(), packageName);
context.put(ContextProperty.INTERFACE.key(), simpleName);
context.put(ContextProperty.CLASS.key(), generatedSimpleClassName);
context.put(ContextProperty.FIELDS.key(), fields);
context.put(DataElementTemplateProperty.PACKAGE.getKey(), packageName);
context.put(DataElementTemplateProperty.INTERFACE.getKey(), simpleName);
context.put(DataElementTemplateProperty.CLASS.getKey(), generatedSimpleClassName);
context.put(DataElementTemplateProperty.FIELDS.getKey(), fields);

// Write to file
final JavaFileObject generatedClassFile = processingEnv.getFiler().createSourceFile(generatedClassName);
Expand Down
@@ -1,21 +1,17 @@
package org.eclipse.ice.dev.annotations.processors;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Enumeration for Keys used in DataElement Velocity Template.
*/
enum ContextProperty {
@AllArgsConstructor
enum DataElementTemplateProperty {
PACKAGE("package"),
FIELDS("fields"),
INTERFACE("interface"),
CLASS("class");

private String key;

ContextProperty(String key) {
this.key = key;
}

String key() {
return this.key;
}
@Getter private String key;
}
@@ -0,0 +1,19 @@
package org.eclipse.ice.dev.annotations.processors;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Enumeration of keys of Persistence Handler Template.
* @author Daniel Bluhm
*/
@AllArgsConstructor
enum PersistenceHandlerTemplateProperty {
PACKAGE("package"),
ELEMENT_INTERFACE("elementInterface"),
CLASS("class"),
COLLECTION("collection"),
IMPLEMENTATION("implementation");

@Getter private String key;
}

0 comments on commit 049ed7c

Please sign in to comment.