Class AbstractModelReader<T>

java.lang.Object
io.wcm.devops.conga.model.reader.AbstractModelReader<T>
Type Parameters:
T - Model type
All Implemented Interfaces:
ModelReader<T>
Direct Known Subclasses:
EnvironmentReader, RoleReader

public abstract class AbstractModelReader<T> extends Object implements ModelReader<T>
Shared functionality for model readers.
  • Constructor Details

    • AbstractModelReader

      protected AbstractModelReader(org.yaml.snakeyaml.Yaml yaml)
      Constructor.
      Parameters:
      yaml - YAML
  • Method Details

    • accepts

      public boolean accepts(Resource file)
      Description copied from interface: ModelReader
      Checks if the given file is accepted by this reader.
      Specified by:
      accepts in interface ModelReader<T>
      Parameters:
      file - File
      Returns:
      true if accepted
    • read

      public final T read(Resource file) throws IOException
      Description copied from interface: ModelReader
      Read model
      Specified by:
      read in interface ModelReader<T>
      Parameters:
      file - Model file
      Returns:
      Model object
      Throws:
      IOException - is thrown when I/O exception occurs
    • read

      public final T read(InputStream is) throws IOException
      Description copied from interface: ModelReader
      Read model
      Specified by:
      read in interface ModelReader<T>
      Parameters:
      is - Model file
      Returns:
      Model object
      Throws:
      IOException - is thrown when I/O exception occurs
    • read

      public final T read(Reader reader)
      Description copied from interface: ModelReader
      Read model
      Specified by:
      read in interface ModelReader<T>
      Parameters:
      reader - Model file
      Returns:
      Model object