-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FORGE-1824 - All external leaks should be resolved and functional (ex…
…cept javaee/tests still uses javaee-impl)
- Loading branch information
1 parent
8407cc4
commit 13a315f
Showing
7 changed files
with
251 additions
and
89 deletions.
There are no files selected for viewing
102 changes: 102 additions & 0 deletions
102
javaee/api/src/main/java/org/jboss/forge/addon/javaee/faces/FacesOperations.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,102 @@ | ||
/* | ||
* Copyright 2013 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.addon.javaee.faces; | ||
|
||
import java.io.FileNotFoundException; | ||
|
||
import javax.faces.validator.Validator; | ||
|
||
import org.jboss.forge.addon.parser.java.resources.JavaResource; | ||
import org.jboss.forge.addon.projects.Project; | ||
import org.jboss.forge.addon.resource.DirectoryResource; | ||
import org.jboss.forge.roaster.model.source.JavaClassSource; | ||
import org.jboss.forge.roaster.model.source.MethodSource; | ||
|
||
/** | ||
* This class contains Faces specific operations | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
* | ||
*/ | ||
public interface FacesOperations | ||
{ | ||
/** | ||
* Creates a new {@link JavaResource} in the specified project. If no project is available, use | ||
* {@link FacesOperations#newBackingBean(DirectoryResource, String, String)} | ||
* | ||
* @param project the current project to create the backing bean. Must not be null | ||
* @param backingBeanName the name of the backing bean | ||
* @param backingBeanPackage the package of the backing bean to be created | ||
* @return the created {@link JavaResource} | ||
*/ | ||
public JavaResource newBackingBean(Project project, String backingBeanName, String backingBeanPackage) | ||
throws FileNotFoundException; | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified target. If a project is available, use | ||
* {@link FacesOperations#newBackingBean(Project, String, String)} | ||
* | ||
* @param target the target directory resource to create the backing bean | ||
* @param backingBeanName the name of the backing bean | ||
* @param backingBeanPackage the package of the backing bean to be created | ||
* @return the created {@link JavaResource} | ||
*/ | ||
public JavaResource newBackingBean(DirectoryResource target, String backingBeanName, String backingBeanPackage); | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified project. If no project is available, use | ||
* {@link FacesOperations#newConverter(DirectoryResource, String, String)} | ||
* | ||
* @param project the current project to create the converter. Must not be null | ||
* @param converterName the name of the converter | ||
* @param converterPackage the package of the converter to be created | ||
* @return the created {@link JavaResource} | ||
*/ | ||
public JavaResource newConverter(Project project, String converterName, String converterPackage) | ||
throws FileNotFoundException; | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified target. If a project is available, use | ||
* {@link FacesOperations#newConverter(Project, String, String)} | ||
* | ||
* @param target the target directory resource to create this class | ||
* @param converterName the name of the converter | ||
* @param converterPackage the package of the converter to be created | ||
* @return the created {@link JavaResource} | ||
*/ | ||
public JavaResource newConverter(DirectoryResource target, String converterName, String converterPackage); | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified project. If no project is available, use | ||
* {@link FacesOperations#newValidator(DirectoryResource, String, String)} | ||
* | ||
* @param project the current project to create the validator. Must not be null | ||
* @param validatorName the name of the validator | ||
* @param validatorPackage the package of the validator to be created | ||
* @return the created {@link JavaResource} | ||
*/ | ||
public JavaResource newValidator(Project project, String validatorName, String validatorPackage) | ||
throws FileNotFoundException; | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified target. If a project is available, use | ||
* {@link FacesOperations#newConverter(Project, String, String)} | ||
* | ||
* @param target the target directory resource to create the validator. Must not be null | ||
* @param validatorName the name of the validator | ||
* @param validatorPackage the package of the validator to be created | ||
* @return the created {@link JavaResource} | ||
*/ | ||
public JavaResource newValidator(DirectoryResource target, String validatorName, String validatorPackage); | ||
|
||
/** | ||
* Adds a {@link Validator} method to the given {@link JavaResource}. | ||
*/ | ||
public MethodSource<JavaClassSource> addValidatorMethod(JavaResource target, String name) | ||
throws FileNotFoundException; | ||
} |
92 changes: 92 additions & 0 deletions
92
javaee/api/src/main/java/org/jboss/forge/addon/javaee/jpa/PersistenceOperations.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,92 @@ | ||
/* | ||
* Copyright 2013 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.addon.javaee.jpa; | ||
|
||
import java.io.FileNotFoundException; | ||
|
||
import javax.persistence.GenerationType; | ||
|
||
import org.jboss.forge.addon.parser.java.resources.JavaResource; | ||
import org.jboss.forge.addon.projects.Project; | ||
import org.jboss.forge.addon.resource.DirectoryResource; | ||
import org.jboss.forge.addon.resource.FileResource; | ||
import org.jboss.forge.roaster.model.JavaClass; | ||
|
||
/** | ||
* Defines JPA specific operations | ||
* | ||
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a> | ||
*/ | ||
public interface PersistenceOperations | ||
{ | ||
public static final String DEFAULT_UNIT_SUFFIX = "-persistence-unit"; | ||
public static final String DEFAULT_UNIT_DESC = "Forge Persistence Unit"; | ||
|
||
/** | ||
* Setups JPA in the project | ||
*/ | ||
public FileResource<?> setup(String unitName, Project project, JPADataSource dataSource, boolean configureMetadata); | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified project. If no project is available, use | ||
* {@link PersistenceOperations#newEntity(DirectoryResource, String, String, GenerationType)} | ||
* | ||
* @param project the current project to create the entity. Must not be null | ||
* @param entityName the name of the entity | ||
* @param entityPackage the package of the entity to be created | ||
* @param idStrategy the ID strategy chosen for this entity | ||
* @return the created java resource | ||
* @throws FileNotFoundException if something wrong happens while saving the {@link JavaClass} | ||
*/ | ||
public JavaResource newEntity(Project project, String entityName, String entityPackage, GenerationType idStrategy, | ||
String tableName) throws FileNotFoundException; | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified target. If a project is available, use | ||
* {@link PersistenceOperations#newEntity(Project, String, String, GenerationType)} | ||
* | ||
* @param target the target directory resource to create this class | ||
* @param entityName the name of the entity | ||
* @param entityPackage the package of the entity to be created | ||
* @param idStrategy the ID strategy chosen for this entity | ||
* @param tableName the table name (optional) | ||
* @return the created java resource | ||
* @throws FileNotFoundException if something wrong happens while saving the {@link JavaClass} | ||
*/ | ||
public JavaResource newEntity(DirectoryResource target, String entityName, String entityPackage, | ||
GenerationType idStrategy, String tableName); | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified project. If no project is available, use | ||
* {@link PersistenceOperations#newEntity(DirectoryResource, String, String, GenerationType)} | ||
* | ||
* @param project the current project to create the entity. Must not be null | ||
* @param entityName the name of the entity | ||
* @param entityPackage the package of the entity to be created | ||
* @param idStrategy the ID strategy chosen for this entity | ||
* @return the created java resource | ||
* @throws FileNotFoundException if something wrong happens while saving the {@link JavaClass} | ||
*/ | ||
public JavaResource newEntity(Project project, String entityName, String entityPackage, GenerationType idStrategy) | ||
throws FileNotFoundException; | ||
|
||
/** | ||
* Creates a new {@link JavaResource} in the specified target. If a project is available, use | ||
* {@link PersistenceOperations#newEntity(Project, String, String, GenerationType)} | ||
* | ||
* @param target the target directory resource to create this class | ||
* @param entityName the name of the entity | ||
* @param entityPackage the package of the entity to be created | ||
* @param idStrategy the ID strategy chosen for this entity | ||
* @return the created java resource | ||
* @throws FileNotFoundException if something wrong happens while saving the {@link JavaClass} | ||
*/ | ||
public JavaResource newEntity(DirectoryResource target, String entityName, String entityPackage, | ||
GenerationType idStrategy); | ||
|
||
} |
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.