org.eclipse.xtend.expression
Class ResourceManagerDefaultImpl
java.lang.Object
org.eclipse.xtend.expression.ResourceManagerDefaultImpl
- All Implemented Interfaces:
- ResourceManager
public class ResourceManagerDefaultImpl
- extends java.lang.Object
- implements ResourceManager
Method Summary |
protected java.io.Reader |
createReader(java.io.InputStream in)
Creates a Reader for the given InputStream. |
Resource |
loadResource(java.lang.String fullyQualifiedName,
java.lang.String extension)
Loads a resource. |
void |
registerParser(java.lang.String extension,
ResourceParser parser)
Registers a ResourceParser to the manager. |
void |
setFileEncoding(java.lang.String fileEncoding)
Sets the encoding the ResourceManager should use to load resources. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
registeredParsers
protected java.util.Map<java.lang.String,ResourceParser> registeredParsers
ResourceManagerDefaultImpl
public ResourceManagerDefaultImpl()
loadResource
public Resource loadResource(java.lang.String fullyQualifiedName,
java.lang.String extension)
- Description copied from interface:
ResourceManager
- Loads a resource.
- Specified by:
loadResource
in interface ResourceManager
- Parameters:
fullyQualifiedName
- Resource pathextension
- Valid Xpand extension (xpt,ext,chk)
- Returns:
- The loaded resource
createReader
protected java.io.Reader createReader(java.io.InputStream in)
- Creates a Reader for the given InputStream. If no explicit file encoding is set this method will try to autodetect the file's encoding.
- Parameters:
in
- Some resource input stream
- Returns:
- A Reader for the stream
- Since:
- 4.2
setFileEncoding
public void setFileEncoding(java.lang.String fileEncoding)
- Description copied from interface:
ResourceManager
- Sets the encoding the ResourceManager should use to load resources.
- Specified by:
setFileEncoding
in interface ResourceManager
- Parameters:
fileEncoding
- Valid file encoding
registerParser
public void registerParser(java.lang.String extension,
ResourceParser parser)
- Description copied from interface:
ResourceManager
- Registers a ResourceParser to the manager.
- Specified by:
registerParser
in interface ResourceManager
- Parameters:
extension
- Xpand file extension (xpt,ext,chk)parser
- The parser for the resource type