Class ClasspathInputBinding
java.lang.Object
com.invirgance.convirgance.web.binding.ClasspathInputBinding
- All Implemented Interfaces:
Binding
Retrieves files from within the applications class path.
Allows services to access JSON files packaged within the application's JAR or
WAR files or located in the classpath directories.
- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIterable
<com.invirgance.convirgance.json.JSONObject> getBinding
(com.invirgance.convirgance.json.JSONObject parameters) Retrieves and parses the resource from the class path.com.invirgance.convirgance.input.Input
<com.invirgance.convirgance.json.JSONObject> getInput()
Returns the configured input processor.getPath()
Returns the current path of the JSON file.void
setInput
(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input) Updates the type ofInput
expected for the JSONObject.void
Sets the path to load the JSON file from.
-
Constructor Details
-
ClasspathInputBinding
public ClasspathInputBinding()
-
-
Method Details
-
getInput
public com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> getInput()Returns the configured input processor.- Returns:
- The
Input
of theJSONObject
.
-
setInput
public void setInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input) Updates the type ofInput
expected for the JSONObject.- Parameters:
input
- TheInput
for aJSONObject
.
-
getPath
Returns the current path of the JSON file.- Returns:
- The path.
-
setPath
Sets the path to load the JSON file from.- Parameters:
path
- The path.
-
getBinding
public Iterable<com.invirgance.convirgance.json.JSONObject> getBinding(com.invirgance.convirgance.json.JSONObject parameters) Retrieves and parses the resource from the class path.- Specified by:
getBinding
in interfaceBinding
- Parameters:
parameters
- Required by the Binding interface but not used in this implementation- Returns:
- An
Iterable
ofJSONObject
s from the classpath resource
-