Forge - Parent 1.2.2-SNAPSHOT

org.jboss.forge.resources.java
Class JavaResource

java.lang.Object
  extended by org.jboss.forge.resources.AbstractResource<File>
      extended by org.jboss.forge.resources.FileResource<JavaResource>
          extended by org.jboss.forge.resources.java.JavaResource
All Implemented Interfaces:
Resource<File>

public class JavaResource
extends FileResource<JavaResource>

Author:
Mike Brock, Lincoln Baxter, III

Field Summary
 
Fields inherited from class org.jboss.forge.resources.FileResource
file, lastModification, scratch, scratchFile
 
Fields inherited from class org.jboss.forge.resources.AbstractResource
flags, parent, resourceFactory
 
Constructor Summary
JavaResource(ResourceFactory factory)
           
JavaResource(ResourceFactory factory, File file)
           
 
Method Summary
 JavaResource createFrom(File file)
          Create a new Resource instance for the target file.
protected  List<Resource<?>> doListResources()
          Strategy method for returning child resources.
 Resource<?> getChild(String name)
          Get a child of this resource.
 JavaSource<?> getJavaSource()
          Attempts to perform cast automatically.
 JavaResource setContents(JavaSource<?> source)
           
 String toString()
           
 
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
 
Methods inherited from class org.jboss.forge.resources.AbstractResource
equals, getFlags, getFullyQualifiedName, getResourceFactory, hashCode, isFlagSet, listResources, listResources, setFlag, unsetFlag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaResource

@Inject
public JavaResource(ResourceFactory factory)

JavaResource

public JavaResource(ResourceFactory factory,
                    File file)
Method Detail

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

Forge - Parent 1.2.2-SNAPSHOT

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.