本文整理汇总了Java中net.sf.saxon.expr.Expression类的典型用法代码示例。如果您正苦于以下问题:Java Expression类的具体用法?Java Expression怎么用?Java Expression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Expression类属于net.sf.saxon.expr包,在下文中一共展示了Expression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: isUpdatingExpression
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
private boolean isUpdatingExpression(Expression ex) {
//logger.trace("isUpdatingExpression; got ex: {}; {}", ex.getClass().getName(), ex);
if (ex.isUpdatingExpression()) {
logger.debug("isUpdatingExpression; got updating ex: {}", ex);
return true;
}
if (ex instanceof IntegratedFunctionCall) {
String qName = ex.getExpressionName();
if (bg_remove_document.equals(qName) || bg_remove_cln_documents.equals(qName) || bg_store_document.equals(qName)) {
logger.trace("isUpdatingExpression; got updating UDF: {}", qName);
return true;
}
} else if (ex instanceof UserFunctionCall) {
UserFunctionCall ufc = (UserFunctionCall) ex;
ex = ufc.getFunction().getBody();
}
Iterator<Operand> itr = ex.operands().iterator();
while(itr.hasNext()) {
Expression e = itr.next().getChildExpression();
if (isUpdatingExpression(e)) {
return true;
}
}
return false;
}
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:27,代码来源:XQProcessorServer.java
示例2: RunInstruction
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public RunInstruction(Expression command, int timeout, List args)
{
this.command = command;
this.timeout = timeout;
nArgs = args.size();
if (args.size() > 0 &&
args.get(args.size() - 1) instanceof InputElement.InputInstruction)
{
inputExpr = (InputElement.InputInstruction)args.get(args.size() - 1);
--nArgs;
}
Expression[] sub = new Expression[args.size()];
for (int i = 0; i < args.size(); i++)
sub[i] = (Expression)args.get(i);
setArguments(sub);
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:20,代码来源:RunInstruction.java
示例3: replaceSubExpression
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
/**
* Replace one subexpression by a replacement subexpression
* @param original the original subexpression
* @param replacement the replacement subexpression
* @return true if the original subexpression is found
*/
public boolean replaceSubExpression(Expression original, Expression replacement)
{
boolean found = false;
for (Entry<String, Expression> attrib : attribs.entrySet()) {
Expression exp = attrib.getValue();
if (exp == original) {
attrib.setValue(replacement);
found = true;
}
}
if (content == original) {
content = replacement;
found = true;
}
return found;
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:24,代码来源:InstructionWithContent.java
示例4: calcIndexName
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
/**
* Calculates a string name for a given set of xsl:key definitions. This
* is done very carefully to ensure that the same key will generate the
* same name, regardless of ephemeral things like particular name codes
* or other variables that might be different on a different run.
*
* @param pool Name pool used to look up names
* @param fingerName Fingerprint of the key
* @param definitions List of key definitions
* @param config Associated Saxon configuration
*
* @return A unique string for this xsl:key
*/
private String calcIndexName(NamePool pool,
String fingerName,
List definitions,
Configuration config)
{
StringBuffer sbuf = new StringBuffer();
sbuf.append("key|" + fingerName);
for (int k = 0; k < definitions.size(); k++)
{
KeyDefinition def = (KeyDefinition)definitions.get(k);
// Capture the match pattern.
String matchStr = def.getMatch().toString();
sbuf.append("|" + Long.toString(Hash64.hash(matchStr), 16));
// Capture the 'use' expression
if (def.getUse() instanceof Expression)
{
// Saxon likes to dump debug stuff to a PrintStream, and we need to
// capture to a buffer.
//
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(bytes);
((Expression)def.getUse()).display(10, ps, config);
ps.flush();
String useStr = bytes.toString();
sbuf.append("|" + Long.toString(Hash64.hash(useStr), 16));
}
else
sbuf.append("|non-exp");
} // for k
return sbuf.toString();
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:49,代码来源:LazyKeyManager.java
示例5: eval
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Optional<Variable> eval(String expressionString) {
QueryModule evaluatedModule = getModule();
StaticContext wrappingContext = wrapContext(evaluatedModule);
if (wrappingContext != null) {
try {
Expression expression = ExpressionTool.make(expressionString, wrappingContext, 0, Token.EOF, null);
final ExpressionVisitor visitor = ExpressionVisitor.make(wrappingContext);
expression = expression.typeCheck(visitor, new ContextItemStaticInfo(Type.ITEM_TYPE, true));
SlotManager stackFrameMap = xPathContext.getStackFrame().getStackFrameMap();
final int variables = stackFrameMap.getNumberOfVariables();
ExpressionTool.allocateSlots(expression, variables, stackFrameMap);
final SequenceIterator it = expression.iterate(xPathContext);
String[] sequenceValue = SaxonItemConverter.getSequenceValue(it);
if (sequenceValue != null) {
return Optional.of(new Variable("evalResult", sequenceValue[1], sequenceValue[0]));
} else {
return Optional.empty();
}
} catch (AssertionError | Exception e) {
System.err.println("Unable to evaluate: '" + expressionString + "'");
e.printStackTrace();
return Optional.empty();
}
}
return Optional.empty();
}
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:27,代码来源:SaxonExpressionEvaluator.java
示例6: inject
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
@Override
public Expression inject(Expression expression, StaticContext staticContext, int construct, StructuredQName qName) {
log("injecting trace for =" + expression.getClass() + " line: " + expression.getLocation().getLineNumber() + " construct: " + construct + " module: " + staticContext.getSystemId());
TraceExpression trace = new TraceExpression(expression);
trace.setNamespaceResolver(staticContext.getNamespaceResolver());
trace.setConstructType(construct);
trace.setObjectName(qName);
return trace;
}
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:10,代码来源:SaxonExtendedTraceCodeInjector.java
示例7: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
@Override
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException {
if (select == null) {
select = compileSequenceConstructor(exec, decl, iterateAxis(AxisInfo.CHILD), false);
}
return new TestInstruction(select);
}
开发者ID:dita-semia,项目名称:XsltGui,代码行数:10,代码来源:GuiTest.java
示例8: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
@Override
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException {
if (html == null) {
html = compileSequenceConstructor(exec, decl, iterateAxis(AxisInfo.CHILD), false);
}
return new HtmlDialogInstruction(title, size, html, propertiesKey, buttons, blockParent, cssRules, cssUri, resizable);
}
开发者ID:dita-semia,项目名称:XsltGui,代码行数:9,代码来源:GuiHtmlDialog.java
示例9: HtmlDialogInstruction
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public HtmlDialogInstruction( Expression title,
Expression size,
Expression html,
Expression properties,
Expression buttons,
Expression blockParent,
Expression cssRules,
Expression cssUri,
Expression resizable) {
//logger.info("HtmlDialogInstruction: " + title + ", " + size + ", " + html + ", " + properties + ", " + buttons);
Expression[] subs = {title, size, html, properties, buttons, blockParent, cssRules, cssUri, resizable};
setArguments(subs);
}
开发者ID:dita-semia,项目名称:XsltGui,代码行数:14,代码来源:GuiHtmlDialog.java
示例10: setParentPath
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
private void setParentPath(ExpressionBuilder eb, int exIndex, PathBuilder path) {
com.bagri.core.query.Expression ex = eb.getExpression(exIndex);
if (ex != null) {
path.setPath(ex.getPath());
logger.trace("iterate; path switched to: {}; from index: {}", path, exIndex);
}
}
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:8,代码来源:CollectionFinderImpl.java
示例11: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Expression compile(Executable exec)
throws XPathException
{
InputInstruction inst = new InputInstruction();
initializeInstruction(exec, inst);
return inst;
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:8,代码来源:InputElement.java
示例12: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Expression compile(Executable exec)
throws XPathException
{
ArgInstruction inst = new ArgInstruction();
initializeInstruction(exec, inst);
return inst;
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:8,代码来源:ArgElement.java
示例13: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Expression compile(Executable exec)
throws XPathException
{
QueryInstruction inst = new QueryInstruction(connection,
column,
table,
where,
rowTag,
colTag,
disable);
return inst;
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:13,代码来源:SQLQuery.java
示例14: QueryInstruction
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public QueryInstruction(Expression connection, Expression column,
Expression table, Expression where, String rowTag,
String colTag, boolean disable)
{
Expression[] sub = { connection, column, table, where };
setArguments(sub);
this.rowTag = rowTag;
this.colTag = colTag;
this.options = (disable ? ReceiverOptions.DISABLE_ESCAPING : 0);
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:11,代码来源:SQLQuery.java
示例15: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Expression compile(Executable exec)
throws XPathException
{
return new ConnectInstruction(database,
driver,
user,
password,
getPropertyInstructions(exec));
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:10,代码来源:SQLConnect.java
示例16: ConnectInstruction
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public ConnectInstruction(Expression database, Expression driver,
Expression user, Expression password,
List propertyInstructions)
{
Expression[] subs = new Expression[propertyInstructions.size() + 4];
subs[DATABASE] = database;
subs[DRIVER] = driver;
subs[USER] = user;
subs[PASSWORD] = password;
for (int i = 0; i < propertyInstructions.size(); i++) {
subs[i + FIRST_PROPERTY] = (Expression)propertyInstructions.get(i);
}
setArguments(subs);
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:15,代码来源:SQLConnect.java
示例17: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Expression compile(Executable exec)
throws XPathException
{
PropertyInstruction inst = new PropertyInstruction(getPropertyName());
initializeInstruction(exec, inst);
return inst;
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:8,代码来源:SQLProperty.java
示例18: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Expression compile(Executable exec)
throws XPathException
{
ColumnInstruction inst = new ColumnInstruction(getColumnName(), evalSql);
initializeInstruction(exec, inst);
return inst;
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:8,代码来源:SQLColumn.java
示例19: compile
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public Expression compile(Executable exec)
throws XPathException
{
return new InsertInstruction(connection,
table,
getColumnInstructions(exec),
ignoreDuplicate);
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:9,代码来源:SQLInsert.java
示例20: InsertInstruction
import net.sf.saxon.expr.Expression; //导入依赖的package包/类
public InsertInstruction(Expression connection, String table,
List columnInstructions, boolean ignoreDuplicate)
{
Expression[] sub = new Expression[columnInstructions.size() + 1];
sub[CONNECTION] = connection;
for (int i = 0; i < columnInstructions.size(); i++) {
sub[i + FIRST_COLUMN] = (Expression)columnInstructions.get(i);
}
this.table = table;
setArguments(sub);
this.ignoreDuplicate = ignoreDuplicate;
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:13,代码来源:SQLInsert.java
注:本文中的net.sf.saxon.expr.Expression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论