Package org.apache.felix.gogo.runtime
Class Expander
- java.lang.Object
-
- org.apache.felix.gogo.runtime.BaseTokenizer
-
- org.apache.felix.gogo.runtime.Expander
-
public class Expander extends BaseTokenizer
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
asPattern
private static char
EOL
private Evaluate
evaluate
private boolean
generateFileNames
private boolean
inQuote
private boolean
rawVariable
private boolean
semanticJoin
private boolean
unquote
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.CharSequence
ansiEscape(java.lang.CharSequence arg)
private java.util.Collection<java.lang.Object>
asCollection(java.lang.Object val)
private java.util.Map<java.lang.Object,java.lang.Object>
asMap(java.lang.Object val)
private java.lang.Object
doExpand()
private java.lang.Object
expand()
java.lang.Object
expand(java.lang.CharSequence word)
java.lang.Object
expand(java.lang.CharSequence word, boolean generateFileNames, boolean semanticJoin, boolean unquote)
static java.lang.Object
expand(java.lang.CharSequence word, Evaluate eval)
expand variables, quotes and escapes in word.private static java.lang.Object
expand(java.lang.CharSequence word, Evaluate eval, boolean inQuote)
private static java.lang.Object
expand(java.lang.CharSequence word, Evaluate eval, boolean inQuote, boolean generateFileNames, boolean semanticJoin, boolean unquote, boolean asPattern)
protected java.util.List<? extends java.lang.CharSequence>
expandBraces(java.lang.CharSequence arg)
private java.lang.Object
expandExp()
java.lang.Object
expandPattern(java.lang.CharSequence word)
private java.lang.Object
expandVar()
private java.lang.Object
expandVar(boolean rawVariable)
private void
findClosing()
private java.lang.CharSequence
findUntil(java.lang.CharSequence text, int start, java.lang.String closing)
protected java.util.List<? extends java.lang.CharSequence>
generateFileNames(java.lang.CharSequence arg)
private java.lang.Object
getAndEvaluateName()
private java.lang.Object
getName(char closing)
private java.lang.String
getPattern(java.lang.String closing)
private java.lang.Object
getValue()
private Token
group()
private static boolean
isGlobMeta(char ch)
private boolean
isName(char ch)
private static boolean
isRegexMeta(char ch)
private static char
next(java.lang.String str, int index)
private int
numericCompare(java.lang.String s1, java.lang.String s2, boolean caseInsensitive)
private java.lang.String
quote(java.lang.String s, int flagq)
private java.lang.String
sharp(java.lang.String s)
private java.lang.String
toCamelCase(java.lang.String s)
private java.util.Collection<java.lang.Object>
toCollection(java.lang.Object val)
private java.util.List<java.lang.Object>
toList(java.util.Map<java.lang.Object,java.lang.Object> val1, boolean flagk, boolean flagv)
private static java.lang.String
toRegexPattern(java.lang.String str, boolean shortest)
private java.lang.CharSequence
unquote(java.lang.CharSequence arg)
private java.lang.String
unquote(java.lang.String arg)
private static java.lang.String
unquoteGlob(java.lang.String str)
Convert a string containing escape sequences and quotes, representing a glob pattern to the corresponding regexp patternprivate java.lang.String
visible(java.lang.String s)
-
-
-
Field Detail
-
evaluate
private final Evaluate evaluate
-
inQuote
private boolean inQuote
-
generateFileNames
private boolean generateFileNames
-
semanticJoin
private boolean semanticJoin
-
unquote
private boolean unquote
-
asPattern
private boolean asPattern
-
rawVariable
private boolean rawVariable
-
EOL
private static final char EOL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Expander
public Expander(java.lang.CharSequence text, Evaluate evaluate, boolean inQuote, boolean generateFileNames, boolean semanticJoin, boolean unquote, boolean asPattern)
-
-
Method Detail
-
expand
public static java.lang.Object expand(java.lang.CharSequence word, Evaluate eval) throws java.lang.Exception
expand variables, quotes and escapes in word.- Throws:
java.lang.Exception
-
expand
private static java.lang.Object expand(java.lang.CharSequence word, Evaluate eval, boolean inQuote) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expand
private static java.lang.Object expand(java.lang.CharSequence word, Evaluate eval, boolean inQuote, boolean generateFileNames, boolean semanticJoin, boolean unquote, boolean asPattern) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expand
public java.lang.Object expand(java.lang.CharSequence word) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expand
public java.lang.Object expand(java.lang.CharSequence word, boolean generateFileNames, boolean semanticJoin, boolean unquote) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expandPattern
public java.lang.Object expandPattern(java.lang.CharSequence word) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expand
private java.lang.Object expand() throws java.lang.Exception
- Throws:
java.lang.Exception
-
unquote
private java.lang.CharSequence unquote(java.lang.CharSequence arg)
-
expandBraces
protected java.util.List<? extends java.lang.CharSequence> expandBraces(java.lang.CharSequence arg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
generateFileNames
protected java.util.List<? extends java.lang.CharSequence> generateFileNames(java.lang.CharSequence arg) throws java.io.IOException
- Throws:
java.io.IOException
-
doExpand
private java.lang.Object doExpand() throws java.lang.Exception
- Throws:
java.lang.Exception
-
ansiEscape
private java.lang.CharSequence ansiEscape(java.lang.CharSequence arg)
-
expandExp
private java.lang.Object expandExp()
-
group
private Token group()
-
expandVar
private java.lang.Object expandVar() throws java.lang.Exception
- Throws:
java.lang.Exception
-
expandVar
private java.lang.Object expandVar(boolean rawVariable) throws java.lang.Exception
- Throws:
java.lang.Exception
-
quote
private java.lang.String quote(java.lang.String s, int flagq)
-
unquote
private java.lang.String unquote(java.lang.String arg)
-
numericCompare
private int numericCompare(java.lang.String s1, java.lang.String s2, boolean caseInsensitive)
-
toCamelCase
private java.lang.String toCamelCase(java.lang.String s)
-
sharp
private java.lang.String sharp(java.lang.String s)
-
visible
private java.lang.String visible(java.lang.String s)
-
asCollection
private java.util.Collection<java.lang.Object> asCollection(java.lang.Object val)
-
toCollection
private java.util.Collection<java.lang.Object> toCollection(java.lang.Object val)
-
asMap
private java.util.Map<java.lang.Object,java.lang.Object> asMap(java.lang.Object val)
-
toList
private java.util.List<java.lang.Object> toList(java.util.Map<java.lang.Object,java.lang.Object> val1, boolean flagk, boolean flagv)
-
getAndEvaluateName
private java.lang.Object getAndEvaluateName() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getName
private java.lang.Object getName(char closing) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPattern
private java.lang.String getPattern(java.lang.String closing) throws java.lang.Exception
- Throws:
java.lang.Exception
-
findUntil
private java.lang.CharSequence findUntil(java.lang.CharSequence text, int start, java.lang.String closing)
-
getValue
private java.lang.Object getValue() throws java.lang.Exception
- Throws:
java.lang.Exception
-
findClosing
private void findClosing()
-
isRegexMeta
private static boolean isRegexMeta(char ch)
-
isGlobMeta
private static boolean isGlobMeta(char ch)
-
next
private static char next(java.lang.String str, int index)
-
unquoteGlob
private static java.lang.String unquoteGlob(java.lang.String str)
Convert a string containing escape sequences and quotes, representing a glob pattern to the corresponding regexp pattern
-
toRegexPattern
private static java.lang.String toRegexPattern(java.lang.String str, boolean shortest)
-
isName
private boolean isName(char ch)
-
-