类 Tokenizer


  • public class Tokenizer
    extends java.lang.Object
    Bash-like tokenizer. Single and double quotes are just like Bash - single quotes escape everything (including backslashes), newlines are allowed in quotes. backslash-newline indicates a line continuation and is removed. Variable expansion is just like Bash: $NAME or ${NAME[[:][-+=?WORD]}, except it can yield any Object. Variables expanded within double-quotes, or adjacent to a String are converted to String. Unlike bash, indirect variable expansion is supported using ${$NAME}. Only a single variable assignment is recognized, with '=' being the second token. (Bash allows name1=value1 name2=value2 ... command args) Comments can only start where white space is allowed: # or // starts a line comment, /* starts a block comment. The following common uses do NOT start comments: ls http://example.com#anchor ls $dir/*.java
    • 嵌套类概要

      嵌套类 
      修饰符和类型 说明
      static class  Tokenizer.Type  
    • 构造器概要

      构造器 
      构造器 说明
      Tokenizer​(java.lang.CharSequence text)  
      Tokenizer​(java.lang.CharSequence text, Evaluate evaluate, boolean inQuote)  
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.lang.Object expand​(java.lang.CharSequence word, short line, short column)  
      static java.lang.Object expand​(java.lang.CharSequence word, Evaluate eval)
      expand variables, quotes and escapes in word.
      Tokenizer.Type next()  
      Token token()  
      Tokenizer.Type type()  
      java.lang.CharSequence value()  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Tokenizer

        public Tokenizer​(java.lang.CharSequence text)
      • Tokenizer

        public Tokenizer​(java.lang.CharSequence text,
                         Evaluate evaluate,
                         boolean inQuote)
    • 方法详细资料

      • value

        public java.lang.CharSequence value()
      • token

        public Token token()
      • expand

        public static java.lang.Object expand​(java.lang.CharSequence word,
                                              Evaluate eval)
                                       throws java.lang.Exception
        expand variables, quotes and escapes in word.
        参数:
        vars -
        返回:
        抛出:
        java.lang.Exception
      • expand

        public java.lang.Object expand​(java.lang.CharSequence word,
                                       short line,
                                       short column)
                                throws java.lang.Exception
        抛出:
        java.lang.Exception