当前位置: 首页>>代码示例>>Java>>正文


Java LiteralArgument类代码示例

本文整理汇总了Java中org.alfresco.repo.search.impl.querymodel.LiteralArgument的典型用法代码示例。如果您正苦于以下问题:Java LiteralArgument类的具体用法?Java LiteralArgument怎么用?Java LiteralArgument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LiteralArgument类属于org.alfresco.repo.search.impl.querymodel包,在下文中一共展示了LiteralArgument类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addComponent

import org.alfresco.repo.search.impl.querymodel.LiteralArgument; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
        throws E
{
    LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
    PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
    Argument inverseArgument = functionArgs.get(ARG_NOT);
    Boolean not = DefaultTypeConverter.INSTANCE.convert(Boolean.class, inverseArgument.getValue(functionContext));
    LiteralArgument modeArgument = (LiteralArgument) functionArgs.get(ARG_MODE);
    String modeString = DefaultTypeConverter.INSTANCE.convert(String.class, modeArgument.getValue(functionContext));
    PredicateMode mode = PredicateMode.valueOf(modeString);

    ListArgument listArgument = (ListArgument) functionArgs.get(ARG_LIST);
    Collection<Serializable> collection = (Collection<Serializable>) listArgument.getValue(functionContext);

    Q query = functionContext.buildLuceneIn(lqpa, propertyArgument.getPropertyName(), collection, not, mode);

    if (query == null)
    {
        throw new QueryModelException("No query time mapping for property  " + propertyArgument.getPropertyName() + ", it should not be allowed in predicates");
    }

    return query;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:25,代码来源:LuceneIn.java

示例2: buildPhrase

import org.alfresco.repo.search.impl.querymodel.LiteralArgument; //导入依赖的package包/类
static private Constraint buildPhrase(CommonTree testNode, QueryModelFactory factory,
        FunctionEvaluationContext functionEvaluationContext, Selector selector, Map<String, Column> columnMap)
{
    String functionName = FTSPhrase.NAME;
    Function function = factory.getFunction(functionName);
    Map<String, Argument> functionArguments = new LinkedHashMap<String, Argument>();
    LiteralArgument larg = factory.createLiteralArgument(FTSPhrase.ARG_PHRASE, DataTypeDefinition.TEXT, getText(testNode.getChild(0)));
    functionArguments.put(larg.getName(), larg);
    larg = factory.createLiteralArgument(FTSPhrase.ARG_TOKENISATION_MODE, DataTypeDefinition.ANY, AnalysisMode.DEFAULT);
    functionArguments.put(larg.getName(), larg);
    return factory.createFunctionalConstraint(function, functionArguments);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:13,代码来源:CMISFTSQueryParser.java

示例3: buildTerm

import org.alfresco.repo.search.impl.querymodel.LiteralArgument; //导入依赖的package包/类
static private Constraint buildTerm(CommonTree testNode, QueryModelFactory factory, FunctionEvaluationContext functionEvaluationContext,
        Selector selector, Map<String, Column> columnMap)
{
    String functionName = FTSTerm.NAME;
    Function function = factory.getFunction(functionName);
    Map<String, Argument> functionArguments = new LinkedHashMap<String, Argument>();
    LiteralArgument larg = factory.createLiteralArgument(FTSTerm.ARG_TERM, DataTypeDefinition.TEXT, getText(testNode.getChild(0)));
    functionArguments.put(larg.getName(), larg);
    larg = factory.createLiteralArgument(FTSTerm.ARG_TOKENISATION_MODE, DataTypeDefinition.ANY, AnalysisMode.DEFAULT);
    functionArguments.put(larg.getName(), larg);
    return factory.createFunctionalConstraint(function, functionArguments);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:13,代码来源:CMISFTSQueryParser.java

示例4: createLiteralArgument

import org.alfresco.repo.search.impl.querymodel.LiteralArgument; //导入依赖的package包/类
@Override
public LiteralArgument createLiteralArgument(String name, QName type, Serializable value)
{
    return new DBLiteralArgument(name, type, value);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:6,代码来源:DBQueryModelFactory.java

示例5: createLiteralArgument

import org.alfresco.repo.search.impl.querymodel.LiteralArgument; //导入依赖的package包/类
public LiteralArgument createLiteralArgument(String name, QName type, Serializable value)
{
    return new LuceneLiteralArgument(name, type, value);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:5,代码来源:LuceneQueryModelFactory.java

示例6: checkPredicateConditionsForIn

import org.alfresco.repo.search.impl.querymodel.LiteralArgument; //导入依赖的package包/类
private void checkPredicateConditionsForIn(Map<String, Argument> functionArguments,
        FunctionEvaluationContext functionEvaluationContext, Map<String, Column> columnMap)
{
    if (options.getQueryMode() == CMISQueryMode.CMS_STRICT)
    {
        PropertyArgument propertyArgument = (PropertyArgument) functionArguments.get(In.ARG_PROPERTY);
        LiteralArgument modeArgument = (LiteralArgument) functionArguments.get(In.ARG_MODE);
        String modeString = DefaultTypeConverter.INSTANCE.convert(String.class,
                modeArgument.getValue(functionEvaluationContext));
        PredicateMode mode = PredicateMode.valueOf(modeString);
        String propertyName = propertyArgument.getPropertyName();

        Column column = columnMap.get(propertyName);
        if (column != null)
        {
            // check for function type
            if (column.getFunction().getName().equals(PropertyAccessor.NAME))
            {
                PropertyArgument arg = (PropertyArgument) column.getFunctionArguments().get(
                        PropertyAccessor.ARG_PROPERTY);
                propertyName = arg.getPropertyName();
            } else
            {
                throw new CmisInvalidArgumentException("Complex column reference not supoprted in LIKE "
                        + propertyName);
            }
        }

        boolean isMultiValued = functionEvaluationContext.isMultiValued(propertyName);

        switch (mode)
        {
        case ANY:
            if (isMultiValued)
            {
                break;
            } else
            {
                throw new QueryModelException("Predicate mode " + PredicateMode.ANY
                        + " is not supported for IN and single valued properties");
            }
        case SINGLE_VALUED_PROPERTY:
            if (isMultiValued)
            {
                throw new QueryModelException("Predicate mode " + PredicateMode.SINGLE_VALUED_PROPERTY
                        + " is not supported for IN and multi-valued properties");
            } else
            {
                break;
            }
        default:
            throw new QueryModelException("Unsupported predicate mode " + mode);
        }

        PropertyDefinitionWrapper propDef = cmisDictionaryService.findPropertyByQueryName(propertyName);
        if (propDef.getPropertyDefinition().getPropertyType() == PropertyType.BOOLEAN)
        {
            throw new QueryModelException("In is not supported for properties of type Boolean");
        }
    }

}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:63,代码来源:CMISQueryParser.java


注:本文中的org.alfresco.repo.search.impl.querymodel.LiteralArgument类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。