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.voidsetInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input) Updates the type ofInputexpected for the JSONObject.voidSets 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
Inputof theJSONObject.
-
setInput
public void setInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input) Updates the type ofInputexpected for the JSONObject.- Parameters:
input- TheInputfor 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:
getBindingin interfaceBinding- Parameters:
parameters- Required by the Binding interface but not used in this implementation- Returns:
- An
IterableofJSONObjects from the classpath resource
-