jjdh.java.resource
Class Loader<T>
java.lang.Object
jjdh.java.resource.Loader<T>
- Type Parameters:
T
- the Type of the Resource which should be decoded by this loader
- Direct Known Subclasses:
- ClassObjectLoader, MD2Loader
public abstract class Loader<T>
- extends Object
- Author:
- Dennis Heidsiek, Jonas Jacobi
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
provider
protected final ResourceProvider provider
shortcut
protected final ResourceReference shortcut
Loader
public Loader()
Loader
public Loader(String shortcut)
resolve
protected ResourceReference resolve(String regex)
- Try to resolve a textual reference to a resource into a correct
ResourceReference. This method also tests the textual reference with the
shortcut as prefix.
- Parameters:
regex
- a reference to the resource
- Returns:
- the correct reference, null otherwise
loadSeveral
public List<T> loadSeveral(String regex)
- Loads and decodes Several resources at once.
- Parameters:
regex
- a reference to a directory with resources
- Returns:
- the loaded resource
load
public T load(String regex)
- Loads and decode a resource.
- Parameters:
regex
- a reference to the resource
- Returns:
- the loaded resource
load
public final T load(ResourceReference res)
- Loads a resource.
- Parameters:
res
- a reference to the resource
- Returns:
- the loaded resource
load
public final T load(InputStream inputStream)
decode
protected abstract T decode(InputStream in)
throws Exception
- Throws:
Exception
Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.