private void rewriteClassReferenceToFQCN(int fields) { String FQCN = egressType.getName(); if (typeDescr.getClassName().indexOf('.') == -1) { int idx = ArrayTools.findFirst('(', 0, name.length, name); char[] fqcn = FQCN.toCharArray(); if (idx == -1) { this.name = new char[idx = fqcn.length]; for (int i = 0; i < idx; i++) this.name[i] = fqcn[i]; } else { char[] newName = new char[fqcn.length + (name.length - idx)]; for (int i = 0; i < fqcn.length; i++) newName[i] = fqcn[i]; int i0 = name.length - idx; int i1 = fqcn.length; for (int i = 0; i < i0; i++) newName[i + i1] = name[i + idx]; this.name = newName; } this.typeDescr.updateClassName(name, 0, name.length, fields); } }
public StaticImportNode(char[] expr) { try { declaringClass = Class.forName(new String(subset(expr, 0, findLast('.', this.name = expr))), true, currentThread().getContextClassLoader()); methodName = new String(subset(expr, findLast('.', expr) + 1)); if (resolveMethod() == null) { throw new CompileException("can not find method for static import: " + declaringClass.getName() + "." + methodName); } } catch (Exception e) { throw new CompileException("unable to import class", e); } }
String tmp; if (isLiteralOnly(expr, start, end)) { if (pCtx != null && pCtx.hasImports()) { char[] _subset = subset(expr, start, cursor - start); int offset; if ((offset = findFirst('.', _subset)) != -1) { String iStr = new String(_subset, 0, offset); if (pCtx.hasImport(iStr)) {
private void rewriteClassReferenceToFQCN(int fields) { String FQCN = egressType.getName(); if (typeDescr.getClassName().indexOf('.') == -1) { int idx = ArrayTools.findFirst('(', 0, name.length, name); char[] fqcn = FQCN.toCharArray(); if (idx == -1) { this.name = new char[idx = fqcn.length]; for (int i = 0; i < idx; i++) this.name[i] = fqcn[i]; } else { char[] newName = new char[fqcn.length + (name.length - idx)]; for (int i = 0; i < fqcn.length; i++) newName[i] = fqcn[i]; int i0 = name.length - idx; int i1 = fqcn.length; for (int i = 0; i < i0; i++) newName[i + i1] = name[i + idx]; this.name = newName; } this.typeDescr.updateClassName(name, 0, name.length, fields); } }
public StaticImportNode(char[] expr, int start, int offset, ParserContext pCtx) { super(pCtx); try { this.expr = expr; this.start = start; this.offset = offset; int mark; ClassLoader classLoader = getClassLoader(); declaringClass = Class.forName(new String(expr, start, (mark = findLast('.', start, offset, this.expr = expr)) - start), true, classLoader ); methodName = new String(expr, ++mark, offset - (mark - start)); if (resolveMethod() == null) { throw new CompileException("can not find method for static import: " + declaringClass.getName() + "." + methodName, expr, start); } } catch (Exception e) { throw new CompileException("unable to import class", expr, start, e); } }
private void rewriteClassReferenceToFQCN(int fields) { String FQCN = egressType.getName(); if (typeDescr.getClassName().indexOf('.') == -1) { int idx = ArrayTools.findFirst('(', name); char[] fqcn = FQCN.toCharArray(); if (idx == -1) { this.name = new char[idx = fqcn.length]; for (int i = 0; i < idx; i++) this.name[i] = fqcn[i]; } else { char[] newName = new char[fqcn.length + (name.length - idx)]; for (int i = 0; i < fqcn.length; i++) newName[i] = fqcn[i]; int i0 = name.length - idx; int i1 = fqcn.length; for (int i = 0; i < i0; i++) newName[i + i1] = name[i + idx]; this.name = newName; } this.typeDescr.updateClassName(name, fields); } }
public StaticImportNode(char[] expr, int start, int offset, ParserContext pCtx) { super(pCtx); try { this.expr = expr; this.start = start; this.offset = offset; int mark; ClassLoader classLoader = getClassLoader(); declaringClass = Class.forName(new String(expr, start, (mark = findLast('.', start, offset, this.expr = expr)) - start), true, classLoader ); methodName = new String(expr, ++mark, offset - (mark - start)); if (resolveMethod() == null) { throw new CompileException("can not find method for static import: " + declaringClass.getName() + "." + methodName, expr, start); } } catch (Exception e) { throw new CompileException("unable to import class", expr, start, e); } }
public AssignmentNode(char[] expr, int fields, ParserContext pCtx) { this.name = expr; int assignStart; if ((assignStart = find(expr, '=')) != -1) { this.varName = createStringTrimmed(expr, 0, assignStart); stmt = subset(expr, assignStart + 1); if ((fields & COMPILE_IMMEDIATE) != 0) { this.egressType = (statement = (ExecutableStatement) subCompileExpression(stmt, pCtx)).getKnownEgressType(); } if (col = ((endOfName = findFirst('[', indexTarget = this.varName.toCharArray())) > 0)) { if (((this.fields |= COLLECTION) & COMPILE_IMMEDIATE) != 0) { accExpr = (CompiledAccExpression) compileSetExpression(indexTarget, pCtx); } this.varName = new String(expr, 0, endOfName); index = new String(indexTarget, endOfName, indexTarget.length - endOfName); } checkNameSafety(this.varName); } else { checkNameSafety(this.varName = new String(expr)); } if ((fields & COMPILE_IMMEDIATE) != 0) { pCtx.addVariable(this.varName, egressType); } this.name = this.varName.toCharArray(); }
String s = new String(subset(expression, 0, ArrayTools.findFirst('(', start, length, expression))); Class cls = ParseTools.findClass(vars, s, pCtx);
String s = new String(subset(expression, 0, ArrayTools.findFirst('(', start, length, expression))); Class cls = ParseTools.findClass(vars, s, pCtx);
Class cls = findClass(factory, new String(subset(name, 0, findFirst('(', 0, name.length, name))).trim(), pCtx);
Class cls = findClass(factory, new String(subset(name, 0, findFirst('(', name))), null);
if (col = ((endOfName = findFirst('[', 0, this.varName.length(), indexTarget = this.varName.toCharArray())) > 0)) { if (((this.fields |= COLLECTION) & COMPILE_IMMEDIATE) != 0) { accExpr = (CompiledAccExpression) compileSetExpression(indexTarget, pCtx);
Class cls = findClass(factory, new String(subset(name, 0, findFirst('(', 0, name.length, name))).trim(), pCtx);
String s = new String(subset(expression, 0, ArrayTools.findFirst('(', expression))); Class cls = ParseTools.findClass(vars, s, pCtx);
if (col = ((endOfName = findFirst('[', 0, this.varName.length(), indexTarget = this.varName.toCharArray())) > 0)) { if (((this.fields |= COLLECTION) & COMPILE_IMMEDIATE) != 0) { accExpr = (CompiledAccExpression) compileSetExpression(indexTarget, pCtx);
Class cls = findClass(factory, new String(subset(property, 0, findFirst('(', start, length, property))), pCtx);