use of org.eclipse.scout.rt.server.jdbc.parsers.token.ValueOutputToken in project scout.rt by eclipse.
the class IntoParser method parseStdBind.
private boolean parseStdBind() {
if (LOG.isTraceEnabled()) {
trace("parseStdBind");
}
int index = m_pos.getIndex();
if (matches(":") && parseName()) {
addIntoToken(new ValueOutputToken(m_str.substring(index, m_pos.getIndex()), m_str.substring(index + 1, m_pos.getIndex()), true));
return true;
}
m_pos.setIndex(index);
return false;
}
use of org.eclipse.scout.rt.server.jdbc.parsers.token.ValueOutputToken in project scout.rt by eclipse.
the class StatementProcessor method createOutput.
@SuppressWarnings("bsiRulesDefinition:htmlInString")
private IBindOutput createOutput(IToken bindToken, Object[] bindBases) {
if (bindToken instanceof ValueOutputToken) {
IBindOutput result = null;
ValueOutputToken valueOutputToken = (ValueOutputToken) bindToken;
String[] path = REGEX_DOT.split(valueOutputToken.getName());
for (int i = 0; i < bindBases.length; i++) {
IBindOutput out = createOutputRec(valueOutputToken, path, bindBases[i]);
if (out != null) {
if (isBindDuplicateCheckEnabled()) {
if (result == null) {
// first match found for the bind -> remember
result = out;
} else {
// second match found
onDuplicateBind(valueOutputToken);
return result;
}
} else {
// no duplicate check necessary: directly return the first match
return out;
}
}
}
if (result == null) {
throw new ProcessingException("Cannot find output for '{}' in bind base. When selecting into shared context variables make sure these variables are initialized using CONTEXT.set<i>PropertyName</i>(null)", valueOutputToken);
}
return result;
}
throw new ProcessingException("Cannot find output for {}", bindToken.getClass());
}
use of org.eclipse.scout.rt.server.jdbc.parsers.token.ValueOutputToken in project scout.rt by eclipse.
the class IntoParser method parse.
public IntoModel parse() {
m_pos = new ParsePosition(0);
parseStatement();
addTextUntil(m_str.length());
if (m_pos.getIndex() < m_str.length()) {
LOG.warn("statement not fully parsed (index {}): {}", m_pos.getIndex(), m_str);
}
return new IntoModel(m_filteredText.toString(), m_intoList.toArray(new ValueOutputToken[0]));
}
use of org.eclipse.scout.rt.server.jdbc.parsers.token.ValueOutputToken in project scout.rt by eclipse.
the class IntoParser method parsePlainBind.
private boolean parsePlainBind() {
if (LOG.isTraceEnabled()) {
trace("parsePlainBind");
}
int index = m_pos.getIndex();
if (matches("&") && parseName() && matches("&")) {
addIntoToken(new ValueOutputToken(m_str.substring(index, m_pos.getIndex()), m_str.substring(index + 1, m_pos.getIndex() - 1), true));
return true;
}
m_pos.setIndex(index);
return false;
}
use of org.eclipse.scout.rt.server.jdbc.parsers.token.ValueOutputToken in project scout.rt by eclipse.
the class IntoParser method parseHashBind.
private boolean parseHashBind() {
if (LOG.isTraceEnabled()) {
trace("parseHashBind");
}
int index = m_pos.getIndex();
if (matches("#") && parseName() && matches("#")) {
addIntoToken(new ValueOutputToken(m_str.substring(index, m_pos.getIndex()), m_str.substring(index + 1, m_pos.getIndex() - 1), true));
return true;
}
m_pos.setIndex(index);
return false;
}
Aggregations