/** * Parses the passed string to determine if it's literal or not * * @param in * input String * @return true if the String is literal (doesn't contain <code>#{..}</code> or <code>${..}</code>) */ public static boolean isLiteral(String in) { ELText txt = parse(in); return txt == null || txt.isLiteral(); }
@Override public String toString() { return _txt.toString(); } }
private void flushTextBuffer(boolean child) { if (this.textBuffer.length() > 0) { String s = this.textBuffer.toString(); if (child) { s = trimRight(s); } if (s.length() > 0) { ELText txt = ELText.parse(s); if (txt != null) { if (txt.isLiteral()) { this.instructionBuffer.add(new LiteralTextInstruction(txt.toString())); } else { this.instructionBuffer.add(new TextInstruction(this.alias, txt)); } } } } this.textBuffer.setLength(0); }
if (target != null && target.length() > 0) target = ELText.parse(context.getApplication().getExpressionFactory(), context.getELContext(), target).toString(context.getELContext()); if (target != null && target.length() > 0) target = ELText.parse(context.getApplication().getExpressionFactory(), context.getELContext(), target).toString(context.getELContext());
public Instruction apply(ExpressionFactory factory, ELContext ctx) { ELText nt = this.txt.apply(factory, ctx); if (nt == this.txt) { return this; } return new TextInstruction(alias, nt); }
text.add(new ELText(buff.toString())); buff.setLength(0); vlen = findVarLength(ca, i); if (ctx != null && fact != null) text.add(new ELText(buff.toString())); buff.setLength(0);
public boolean isLiteral() { return txt.isLiteral(); } }
public void write(Writer out, ELContext ctx) throws ELException, IOException { for (int i = 0; i < this.txt.length; i++) { this.txt[i].write(out, ctx); } }
this.buffer.append(' ').append(qname).append("=\"").append(value).append("\""); ELText txt = ELText.parseAllowEmptyString(value); if (txt != null) if (txt.isLiteral()) this.addInstruction(new LiteralAttributeInstruction(qname, txt.toString()));
public void writeText(ResponseWriter out, ELContext ctx) throws ELException, IOException { for (int i = 0; i < this.txt.length; i++) { this.txt[i].writeText(out, ctx); } }
/** * Factory method for creating an unvalidated ELText instance. NOTE: All expressions in the passed String are * treated as {@link org.apache.myfaces.view.facelets.el.LiteralValueExpression LiteralValueExpressions}. * * @param in * String to parse * @return ELText instance that knows if the String was literal or not * @throws javax.el.ELException */ public static ELText parse(String in) throws ELException { return parse(null, null, in); }
public FaceletHandler createFaceletHandler() { FaceletHandler[] h = new FaceletHandler[2]; h[0] = new UIInstructionHandler(this.alias, this.id, new Instruction[]{ new DoctypeInstruction( this.name, this.publicId, this.systemId, this.html5Doctype) }, new ELText("")); h[1] = this.getNextFaceletHandler(); return new CompositeFaceletHandler(h); } }
if (name != null && name.length() > 0) name = ELText.parse(getExpressionFactory(), context.getELContext(), name).toString(context.getELContext()); if (library != null && library.length() > 0) library = ELText.parse(getExpressionFactory(), context.getELContext(), library).toString(context.getELContext()); if (target != null && target.length() > 0) target = ELText.parse(getExpressionFactory(), context.getELContext(), target).toString(context.getELContext());
public ELText apply(ExpressionFactory factory, ELContext ctx) { int len = this.txt.length; ELText[] nt = new ELText[len]; for (int i = 0; i < len; i++) { nt[i] = this.txt[i].apply(factory, ctx); } return new ELTextComposite(nt); } }
text.add(new ELText(buff.toString())); buff.setLength(0); vlen = findVarLength(ca, i); if (ctx != null && fact != null) text.add(new ELText(buff.toString())); buff.setLength(0);
public boolean isLiteral() { return _txt.isLiteral(); } }