protected void Page_Load(object sender, EventArgs e) { Literal some_js = new Literal(); some_js = "<script type='text/javascript' src='some.js'></script>"; this.Header.Controls.Add(some_js); }
@Override public int hashCode() { return value().hashCode(); }
/** * {@inheritDoc} * * @see org.modeshape.jcr.query.model.Literal#accept(org.modeshape.jcr.query.model.Visitor) */ @Override public void accept( Visitor visitor ) { visitorLiteral.accept(visitor); } };
string csurl = null; if (condition) { csurl = "a.js"; } else { csurl = "b.js"; } Literal script = new Literal(); script.Text = string.Format( @"<script src=""{0}"" type=""text/javascript""></script>",csurl); Page.Header.Controls.Add(script);
@Override public int hashCode() { return value().hashCode(); }
protected void Page_Load(object sender, EventArgs e) { Literal l = new Literal(); l.Text = "<script type='text/javascript' src='../../Resources/Xinha/my_config.js'></script>"; this.Page.Header.Controls.Add(l); }
protected Literal literal( TypeSystem typeSystem, Object value ) throws ValueFormatException { return new Literal(value); }
protected static String stringValue( StaticOperand operand, QueryContext context ) { // This is a constraint on the ID of a node ... Object value = null; if (operand instanceof BindVariableName) { BindVariableName varName = (BindVariableName)operand; value = context.getVariables().get(varName.getBindVariableName()); } else if (operand instanceof Literal) { value = ((Literal)operand).value(); } if (value != null && value instanceof String) { return (String)value; } return null; } }
protected Literal literal( TypeSystem typeSystem, Object value ) throws ValueFormatException { return new Literal(value); }
protected static String stringValue( StaticOperand operand, QueryContext context ) { // This is a constraint on the ID of a node ... Object value = null; if (operand instanceof BindVariableName) { BindVariableName varName = (BindVariableName)operand; value = context.getVariables().get(varName.getBindVariableName()); } else if (operand instanceof Literal) { value = ((Literal)operand).value(); } if (value != null && value instanceof String) { return (String)value; } return null; } }
Page.Controls.Add(new Literal() { Text = "<script>myjavascriptfn();</script>" });
/** * Get the value associated with the static operand of the comparison. If the operand is a {@link BindVariableName variable * name}, the variable value is returned. * * @param context the query context; may not be null * @param operand the static operand; may not be null * @return the value of the static operand */ protected Object getValue( QueryContext context, StaticOperand operand ) { if (operand instanceof Literal) { Literal literal = (Literal)operand; return literal.value(); } BindVariableName variable = (BindVariableName)operand; return context.getVariables().get(variable.getBindVariableName()); } }
header.Controls.Add(new Literal("<script type='text/javascript'>...</script>"));
/** * Get the value associated with the static operand of the comparison. If the operand is a {@link BindVariableName variable * name}, the variable value is returned. * * @param context the query context; may not be null * @param operand the static operand; may not be null * @return the value of the static operand */ protected Object getValue( QueryContext context, StaticOperand operand ) { if (operand instanceof Literal) { Literal literal = (Literal)operand; return literal.value(); } BindVariableName variable = (BindVariableName)operand; return context.getVariables().get(variable.getBindVariableName()); } }
@Override public T toLowerValue( StaticOperand operand, Map<String, Object> variables ) { if (operand instanceof Literal) { Literal literal = (Literal)operand; return factory.create(literal.value()); } if (operand instanceof BindVariableValue) { BindVariableValue bind = (BindVariableValue)operand; return factory.create(variables.get(bind.getBindVariableName())); } throw new LocalIndexException("Unexpected static operand: " + operand); }
protected void Page_Load(object sender, EventArgs e) { List<Item> test = new List<Item>(); test.Add(new Item { Text = "Item 1" } ); test.Add(new Item { Text = "Item 2" } ); repItems.DataSource = test; repItems.DataBind(); } protected void lnkItem_OnClick(object sender, EventArgs e) { this.Controls.Add(new Literal() { Text = ((LinkButton)sender).Text }); } protected void lnkItem_OnCommand(object sender, EventArgs e) { this.Controls.Add(new Literal() { Text = ((LinkButton)sender).Text }); }
@Override public T toUpperValue( StaticOperand operand, Map<String, Object> variables ) { if (operand instanceof Literal) { Literal literal = (Literal)operand; return factory.create(literal.value()); } if (operand instanceof BindVariableValue) { BindVariableValue bind = (BindVariableValue)operand; return factory.create(variables.get(bind.getBindVariableName())); } throw new LocalIndexException("Unexpected static operand: " + operand); }
/** * Define the lower boundary value of a range. * * @param literal the literal value; * @return the constraint builder; never null */ public AndBuilder<UpperBoundary> literal( Path literal ) { return new AndBuilder<UpperBoundary>(new UpperBoundary(comparisonBuilder, new Literal(literal))); }