本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
}
}