|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ResourceDataBroker
Is responsible for getting the necessary resources for the grammar checker library. Following directories are currently needed by a couple of classes:
/resource/rules
Make sure that you never obtain any grammar checker resources by calling
Object.class.getResource(String) or Object.class.getResourceAsStream(String) directly. If you would like to
obtain something from these directories do always use
JLanguageTool.getDataBroker() which provides proper methods for
reading the directories above.
For example, if you want to get the URL of /rules/de/grammar.xml just invoke
getFromRulesDirAsUrl(String) and pass /de/grammar.xml as a string. Note: The /rules directory's name isn't
passed, because its name might have changed. The same usage does apply for the
/resource directory.
| Field Summary | |
|---|---|
static String |
RESOURCE_DIR
The directory name of the /resource directory. |
static String |
RULES_DIR
The directory name of the /rules directory. |
| Method Summary | |
|---|---|
InputStream |
getFromResourceDirAsStream(String path)
Gets any resource from the grammar checker's /resource directory. |
URL |
getFromResourceDirAsUrl(String path)
Gets any resource from the grammar checker's /resource directory. |
InputStream |
getFromRulesDirAsStream(String path)
Gets any resource from the grammar checker's /rules directory. |
URL |
getFromRulesDirAsUrl(String path)
Gets any resource from the grammar checker's /rules directory. |
String |
getResourceDir()
|
String |
getRulesDir()
|
void |
setResourceDir(String resourceDir)
|
void |
setRulesDir(String rulesDir)
|
| Field Detail |
|---|
static final String RESOURCE_DIR
/resource directory.
static final String RULES_DIR
/rules directory.
| Method Detail |
|---|
URL getFromResourceDirAsUrl(String path)
/resource directory.
path - Path to an item from the /resource directory.
URL object to the requested item or null if it
wasn't found.InputStream getFromResourceDirAsStream(String path)
/resource directory.
path - Path to an item from the /resource directory.
InputStream object to the requested item or null
if it wasn't found.URL getFromRulesDirAsUrl(String path)
/rules directory.
path - Path to an item from the /rules directory.
URL object to the requested item or null if it
wasn't found.InputStream getFromRulesDirAsStream(String path)
/rules directory.
path - Path to an item from the /rules directory.
InputStream object to the requested item or null if it wasn't found.String getResourceDir()
/subdir/furtherdir/resourcedir
void setResourceDir(String resourceDir)
resourceDir - The used directory path to the /resource directory.
Make sure that you comply with the following format when setting
this value:
/subdir/furtherdir/resourcedir
String getRulesDir()
/subdir/furtherdir/rulesdir
void setRulesDir(String rulesDir)
rulesDir - The used directory path to the /rules directory. Make
sure that you comply with the following format when setting this
value:
/subdir/furtherdir/rulesdir
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||