org.jboss.forge.resources.java
Class JavaResource
java.lang.Object
org.jboss.forge.resources.AbstractResource<File>
org.jboss.forge.resources.FileResource<JavaResource>
org.jboss.forge.resources.java.JavaResource
- All Implemented Interfaces:
- Resource<File>
public class JavaResource
- extends FileResource<JavaResource>
- Author:
- Mike Brock, Lincoln Baxter, III
| Methods inherited from class org.jboss.forge.resources.FileResource |
createNewFile, createTempResource, delete, delete, deleteOnExit, exists, getName, getParent, getResourceInputStream, getUnderlyingResourceObject, isDirectory, isStale, markUpToDate, mkdir, mkdirs, reify, renameTo, renameTo, setContents, setContents, setContents |
JavaResource
@Inject
public JavaResource(ResourceFactory factory)
JavaResource
public JavaResource(ResourceFactory factory,
File file)
getChild
public Resource<?> getChild(String name)
- Description copied from interface:
Resource
- Get a child of this resource. Returns null if no child by the given name can be found.
- Specified by:
getChild in interface Resource<File>- Overrides:
getChild in class FileResource<JavaResource>
doListResources
protected List<Resource<?>> doListResources()
- Description copied from class:
AbstractResource
- Strategy method for returning child resources. Subclasses should implement or override this method.
- Specified by:
doListResources in class AbstractResource<File>
- Returns:
setContents
public JavaResource setContents(JavaSource<?> source)
getJavaSource
public JavaSource<?> getJavaSource()
throws FileNotFoundException
- Attempts to perform cast automatically. This can lead to problems.
- Throws:
FileNotFoundException
createFrom
public JavaResource createFrom(File file)
- Description copied from class:
FileResource
- Create a new
Resource instance for the target file. The new Resource should be of the same type as
this.
- Specified by:
createFrom in interface Resource<File>- Specified by:
createFrom in class FileResource<JavaResource>
- Parameters:
file - The file to create the resource instance from.
- Returns:
- A new resource.
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.