Class Template


  • public class Template
    extends java.lang.Object
    A template consisting of a name and a pattern.

    Clients may instantiate this class. May become final in the future.

    Since:
    3.0
    Restriction:
    This class is not intended to be subclassed by clients.
    • Constructor Summary

      Constructors 
      Constructor Description
      Template()
      Creates an empty template.
      Template​(java.lang.String name, java.lang.String description, java.lang.String contextTypeId, java.lang.String pattern)
      Deprecated.
      Template​(java.lang.String name, java.lang.String description, java.lang.String contextTypeId, java.lang.String pattern, boolean isAutoInsertable)
      Creates a template.
      Template​(Template template)
      Creates a copy of a template.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getContextTypeId()
      Returns the id of the context type in which the template can be applied.
      java.lang.String getDescription()
      Returns the description of the template.
      java.lang.String getName()
      Returns the name of the template.
      java.lang.String getPattern()
      Returns the template pattern.
      int hashCode()  
      boolean isAutoInsertable()
      Returns the auto insertable property of the template.
      boolean matches​(java.lang.String prefix, java.lang.String contextTypeId)
      Returns true if template is enabled and matches the context, false otherwise.
      void setContextTypeId​(java.lang.String contextTypeId)
      Deprecated.
      Templates should never be modified
      void setDescription​(java.lang.String description)
      Deprecated.
      Templates should never be modified
      void setName​(java.lang.String name)
      Deprecated.
      Templates should never be modified
      void setPattern​(java.lang.String pattern)
      Deprecated.
      Templates should never be modified
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Template

        public Template()
        Creates an empty template.
      • Template

        public Template​(Template template)
        Creates a copy of a template.
        Parameters:
        template - the template to copy
      • Template

        @Deprecated
        public Template​(java.lang.String name,
                        java.lang.String description,
                        java.lang.String contextTypeId,
                        java.lang.String pattern)
        Deprecated.
        Creates a template.
        Parameters:
        name - the name of the template
        description - the description of the template
        contextTypeId - the id of the context type in which the template can be applied
        pattern - the template pattern
      • Template

        public Template​(java.lang.String name,
                        java.lang.String description,
                        java.lang.String contextTypeId,
                        java.lang.String pattern,
                        boolean isAutoInsertable)
        Creates a template.
        Parameters:
        name - the name of the template
        description - the description of the template
        contextTypeId - the id of the context type in which the template can be applied
        pattern - the template pattern
        isAutoInsertable - the auto insertable property of the template
        Since:
        3.1
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • setDescription

        @Deprecated
        public void setDescription​(java.lang.String description)
        Deprecated.
        Templates should never be modified
        Sets the description of the template.
        Parameters:
        description - the new description
      • getDescription

        public java.lang.String getDescription()
        Returns the description of the template.
        Returns:
        the description of the template
      • setContextTypeId

        @Deprecated
        public void setContextTypeId​(java.lang.String contextTypeId)
        Deprecated.
        Templates should never be modified
        Sets the name of the context type in which the template can be applied.
        Parameters:
        contextTypeId - the new context type name
      • getContextTypeId

        public java.lang.String getContextTypeId()
        Returns the id of the context type in which the template can be applied.
        Returns:
        the id of the context type in which the template can be applied
      • setName

        @Deprecated
        public void setName​(java.lang.String name)
        Deprecated.
        Templates should never be modified
        Sets the name of the template.
        Parameters:
        name - the name of the template
      • getName

        public java.lang.String getName()
        Returns the name of the template.
        Returns:
        the name of the template
      • setPattern

        @Deprecated
        public void setPattern​(java.lang.String pattern)
        Deprecated.
        Templates should never be modified
        Sets the pattern of the template.
        Parameters:
        pattern - the new pattern of the template
      • getPattern

        public java.lang.String getPattern()
        Returns the template pattern.
        Returns:
        the template pattern
      • matches

        public boolean matches​(java.lang.String prefix,
                               java.lang.String contextTypeId)
        Returns true if template is enabled and matches the context, false otherwise.
        Parameters:
        prefix - the prefix (e.g. inside a document) to match
        contextTypeId - the context type id to match
        Returns:
        true if template is enabled and matches the context, false otherwise
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • isAutoInsertable

        public boolean isAutoInsertable()
        Returns the auto insertable property of the template.
        Returns:
        the auto insertable property of the template
        Since:
        3.1