Class ClasspathInputBinding

java.lang.Object
com.invirgance.convirgance.web.binding.ClasspathInputBinding
All Implemented Interfaces:
Binding

@Wiring public class ClasspathInputBinding extends Object implements 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Iterable<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>
    Returns the configured input processor.
    Returns the current path of the JSON file.
    void
    setInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input)
    Updates the type of Input expected for the JSONObject.
    void
    Sets the path to load the JSON file from.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the JSONObject.
    • setInput

      public void setInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input)
      Updates the type of Input expected for the JSONObject.
      Parameters:
      input - The Input for a JSONObject.
    • getPath

      public String getPath()
      Returns the current path of the JSON file.
      Returns:
      The path.
    • setPath

      public void setPath(String path)
      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 interface Binding
      Parameters:
      parameters - Required by the Binding interface but not used in this implementation
      Returns:
      An Iterable of JSONObjects from the classpath resource