Class TemplateDescriptor


  • public class TemplateDescriptor
    extends java.lang.Object
    Contains the attributes of an archetype's template (either a source or resource file). The attributes indicate if the template should be filtered and it's encoding.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String encoding
      Determines the template's encoding.
      private boolean filtered
      Determines if the template should be filtered or not.
    • Constructor Summary

      Constructors 
      Constructor Description
      TemplateDescriptor()
      Creates a new instance of TemplateDescriptor that should be filtered and has the default encoding.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String getDefaultEncoding()
      Returns the canonical name of the default character encoding of this Java virtual machine.
      java.lang.String getEncoding()
      Returns the name of the encoding of the template file (e.g.
      boolean isFiltered()
      Returns true if the template should be filtered and false otherwise.
      void setEncoding​(java.lang.String encoding)
      Sets the name of the encoding of the template file.
      void setFiltered​(boolean filtered)
      Defines whether the template should be filtered (processed by Velocity) or not.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • filtered

        private boolean filtered
        Determines if the template should be filtered or not.
      • encoding

        private java.lang.String encoding
        Determines the template's encoding.
    • Constructor Detail

      • TemplateDescriptor

        public TemplateDescriptor()
        Creates a new instance of TemplateDescriptor that should be filtered and has the default encoding.
    • Method Detail

      • getDefaultEncoding

        private static java.lang.String getDefaultEncoding()
        Returns the canonical name of the default character encoding of this Java virtual machine.
        Returns:
        the name of the default character encoding.
      • isFiltered

        public boolean isFiltered()
        Returns true if the template should be filtered and false otherwise.
        Returns:
        true if the template should be filtered and false otherwise.
      • setFiltered

        public void setFiltered​(boolean filtered)
        Defines whether the template should be filtered (processed by Velocity) or not.
        Parameters:
        filtered - true if it should be processed by Velocity and fales otherwise.
      • getEncoding

        public java.lang.String getEncoding()
        Returns the name of the encoding of the template file (e.g. us-ascci, utf-8, iso-8859-1).
        Returns:
        the name of the encoding of the template file.
      • setEncoding

        public void setEncoding​(java.lang.String encoding)
                         throws java.nio.charset.IllegalCharsetNameException,
                                java.nio.charset.UnsupportedCharsetException
        Sets the name of the encoding of the template file.
        Parameters:
        encoding - New value of property encoding.
        Throws:
        java.nio.charset.IllegalCharsetNameException - if the given charset name is illegal
        java.nio.charset.UnsupportedCharsetException - if no support for the named encoding is available in this instance of the Java virtual machine