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 booleanasPatternprivate static charEOLprivate Evaluateevaluateprivate booleangenerateFileNamesprivate booleaninQuoteprivate booleanrawVariableprivate booleansemanticJoinprivate booleanunquote
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.CharSequenceansiEscape(java.lang.CharSequence arg)private <T> java.util.Collection<T>asCollection(java.lang.Object val)private java.util.Map<java.lang.Object,java.lang.Object>asMap(java.lang.Object val)private java.lang.ObjectdoExpand()private java.lang.Objectexpand()java.lang.Objectexpand(java.lang.CharSequence word)java.lang.Objectexpand(java.lang.CharSequence word, boolean generateFileNames, boolean semanticJoin, boolean unquote)static java.lang.Objectexpand(java.lang.CharSequence word, Evaluate eval)expand variables, quotes and escapes in word.private static java.lang.Objectexpand(java.lang.CharSequence word, Evaluate eval, boolean inQuote)private static java.lang.Objectexpand(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.ObjectexpandExp()java.lang.ObjectexpandPattern(java.lang.CharSequence word)private java.lang.ObjectexpandVar()private java.lang.ObjectexpandVar(boolean rawVariable)private voidfindClosing()private java.lang.CharSequencefindUntil(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.ObjectgetAndEvaluateName()private java.lang.ObjectgetName(char closing)private java.lang.StringgetPattern(java.lang.String closing)private java.lang.ObjectgetValue()private Tokengroup()private static booleanisGlobMeta(char ch)private booleanisName(char ch)private static booleanisRegexMeta(char ch)private static charnext(java.lang.String str, int index)private intnumericCompare(java.lang.String s1, java.lang.String s2, boolean caseInsensitive)private java.lang.Stringquote(java.lang.String s, int flagq)private java.lang.Stringsharp(java.lang.String s)private java.lang.StringtoCamelCase(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.StringtoRegexPattern(java.lang.String str, boolean shortest)private java.lang.CharSequenceunquote(java.lang.CharSequence arg)private java.lang.Stringunquote(java.lang.String arg)private static java.lang.StringunquoteGlob(java.lang.String str)Convert a string containing escape sequences and quotes, representing a glob pattern to the corresponding regexp patternprivate java.lang.Stringvisible(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.Exceptionexpand variables, quotes and escapes in word.- Parameters:
word- the wordeval- the eval- Returns:
- Object
- Throws:
java.lang.Exception- on 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 <T> java.util.Collection<T> 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)
-
-