Class WikiText.Template

    • Method Detail

      • setEndOffset

        protected void setEndOffset​(int position)
        sets the end offset to the given position (should point to the first char of the closing "}}")
        Overrides:
        setEndOffset in class WikiText.Token
        Parameters:
        position - the position of the first character of the enclosing "}}"
      • getName

        public String getName()
      • getParsedArgs

        public Map<String,​String> getParsedArgs()
        return the IMMUTABLE argName/argValue Map. argName being a String and argValue a String.

        When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.

        Returns:
        the argName/argVal map
      • cloneParsedArgs

        public Map<String,​String> cloneParsedArgs()
        return a MUTABLE clone of argName/argValue Map. argName being a String and argValue a String.

        When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.

        Returns:
        the argName/argVal map
      • getParsedArg

        public String getParsedArg​(String key)
        get the String value of the requested argument key. If the argument contain wiki tokens, the source text is returned. Use getArgs if you want to get the WikiContent associated to the key.
        Parameters:
        key - the key of the argument to be retrieved
        Returns:
        the value of the argument or null if the argument was not specified
      • getParsedArg

        public String getParsedArg​(String key,
                                   String defaultValue)
        get the String value of the requested argument key, or return default value if argument value is null. If the argument contain wiki tokens, the source text is returned. Use getArgs if you want to get the WikiContent associated to the key.
        Parameters:
        key - the key of the argument to be retrieved
        defaultValue - the default value returned if the argument is undefined
        Returns:
        the value of the argument or defaultValue
      • getArgs

        public LinkedHashMap<String,​WikiText.WikiContent> getArgs()
        return the argName/argValue Map. argName being a String and argValue a WikiContent. When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.
        Returns:
        the argName/argVal map
      • cloneArgs

        public Map<String,​WikiText.WikiContent> cloneArgs()
        return a MUTABLE clone of argName/argValue Map. argName being a String and argValue a String.

        When iterated, the map will provide values or entries in insertion order, hence iterating over the map will give args in the order they were defined.

        Returns:
        the argName/argVal map
      • getArg

        public WikiText.WikiContent getArg​(String key)
        get the WikiContent value of the requested argument key.
        Parameters:
        key - the key of the argument to be retrieved
        Returns:
        the value of the argument or null if the argument was not specified
      • accept

        public <T> T accept​(Visitor<T> visitor)