java.lang.Object
be.kuleuven.cs.distrinet.sparta.io.templates.Template<T>
Direct Known Subclasses:
DescriptionDiagramItemTemplate, DescriptionDiagramsTemplate, StaticTemplate, ThreatItemDiagramTemplate, ThreatItemTemplate, ThreatsTemplate

public abstract class Template<T> extends Object
  • Constructor Details

    • Template

      protected Template(String filename)
  • Method Details

    • getFilename

      public String getFilename()
    • getTemplate

      public String getTemplate()
      The raw template text. The classpath resource is read lazily on first access and cached, so constructing a template (including the static singleton instances) never fails; a missing or unreadable resource surfaces as an UncheckedIOException when the template is used.
      Returns:
      the template text
      Throws:
      UncheckedIOException - if the template resource is missing or unreadable
    • instantiate

      public abstract String instantiate(T obj)
    • toString

      public String toString()
      Overrides:
      toString in class Object