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


Java Constants类代码示例

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


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

示例1: LDPathMethod

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
public LDPathMethod(RDFBackend<Node> backend) {
    this.ldpath  = new LDPath<Node>(backend);
    this.backend = backend;

    // register custom freemarker transformers for the parser so we get the results immediately in the freemarker model
    ldpath.registerTransformer(Constants.NS_XSD + "string", new TemplateScalarTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "decimal", new TemplateLongTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "integer", new TemplateIntegerTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "long", new TemplateLongTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "short", new TemplateIntegerTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "double", new TemplateDoubleTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "float", new TemplateFloatTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "dateTime", new TemplateDateTransformer<Node>(TemplateDateModel.DATETIME));
    ldpath.registerTransformer(Constants.NS_XSD + "date", new TemplateDateTransformer<Node>(TemplateDateModel.DATE));
    ldpath.registerTransformer(Constants.NS_XSD + "time", new TemplateDateTransformer<Node>(TemplateDateModel.TIME));
    ldpath.registerTransformer(Constants.NS_XSD + "boolean", new TemplateBooleanTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "anyURI", new TemplateScalarTransformer<Node>());

}
 
开发者ID:apache,项目名称:marmotta,代码行数:20,代码来源:LDPathMethod.java

示例2: LDPathDirective

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
public LDPathDirective(RDFBackend<Node> backend) {
    this.ldpath  = new LDPath<Node>(backend);
    this.backend = backend;

    // register custom freemarker transformers for the parser so we get the results immediately in the freemarker model
    ldpath.registerTransformer(Constants.NS_XSD + "string", new TemplateScalarTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "decimal", new TemplateLongTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "integer", new TemplateIntegerTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "long", new TemplateLongTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "short", new TemplateIntegerTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "double", new TemplateDoubleTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "float", new TemplateFloatTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "dateTime", new TemplateDateTransformer<Node>(TemplateDateModel.DATETIME));
    ldpath.registerTransformer(Constants.NS_XSD + "date", new TemplateDateTransformer<Node>(TemplateDateModel.DATE));
    ldpath.registerTransformer(Constants.NS_XSD + "time", new TemplateDateTransformer<Node>(TemplateDateModel.TIME));
    ldpath.registerTransformer(Constants.NS_XSD + "boolean", new TemplateBooleanTransformer<Node>());
    ldpath.registerTransformer(Constants.NS_XSD + "anyURI", new TemplateScalarTransformer<Node>());

}
 
开发者ID:apache,项目名称:marmotta,代码行数:20,代码来源:LDPathDirective.java

示例3: addDefaultTransformers

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
private void addDefaultTransformers() {
    addTransformer(Constants.NS_XSD + "decimal", new BigDecimalTransformer<Node>());
    addTransformer(Constants.NS_XSD + "integer", new BigIntegerTransformer<Node>());
    addTransformer(Constants.NS_XSD + "long", new LongTransformer<Node>());
    addTransformer(Constants.NS_XSD + "int", new IntTransformer<Node>());
    addTransformer(Constants.NS_XSD + "short", new ShortTransformer<Node>());
    addTransformer(Constants.NS_XSD + "byte", new ByteTransformer<Node>());
    addTransformer(Constants.NS_XSD + "double", new DoubleTransformer<Node>());
    addTransformer(Constants.NS_XSD + "float", new FloatTransformer<Node>());
    addTransformer(Constants.NS_XSD + "dateTime", new DateTimeTransformer<Node>());
    addTransformer(Constants.NS_XSD + "date", new DateTransformer<Node>());
    addTransformer(Constants.NS_XSD + "time", new TimeTransformer<Node>());
    addTransformer(Constants.NS_XSD + "boolean", new BooleanTransformer<Node>());
    addTransformer(Constants.NS_XSD + "anyURI", new StringTransformer<Node>());
    addTransformer(Constants.NS_XSD + "string", new StringTransformer<Node>());
    addTransformer(Constants.NS_XSD + "duration", new DurationTransformer<Node>());

}
 
开发者ID:apache,项目名称:marmotta,代码行数:19,代码来源:DefaultConfiguration.java

示例4: registerFunction

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
/**
 * Register an LDPath function in this LDPath service. Can be used by other modules to plug in their own LDPath
 * functions as needed.
 *
 * @param function
 */
@Override
public void registerFunction(SelectorFunction<Value> function) {
    if (function instanceof AutoRegisteredLDPathFunction) {
        config.addFunction(((AutoRegisteredLDPathFunction) function).getLocalName(), function);
    } else {
        try {
            RepositoryConnection conn = sesameService.getConnection();
            try {
                conn.begin();
                SesameConnectionBackend backend = SesameConnectionBackend.withConnection(conn);
                config.addFunction(Constants.NS_LMF_FUNCS + function.getPathExpression(backend), function);
            } finally {
                conn.commit();
                conn.close();
            }
        } catch (RepositoryException e) {
            log.warn("Could not add function:" + function.getSignature(), e);
        }
    }
}
 
开发者ID:apache,项目名称:marmotta,代码行数:27,代码来源:LDPathServiceImpl.java

示例5: initialise

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
@PostConstruct
public void initialise() {
    log.info("initialising LDPath service ...");

    config = new DefaultConfiguration<Value>();

    for(AutoRegisteredLDPathFunction function : functions) {
        config.addFunction(Constants.NS_LMF_FUNCS + function.getLocalName(), function);
    }
}
 
开发者ID:apache,项目名称:marmotta,代码行数:11,代码来源:LDPathServiceImpl.java

示例6: addFunction

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
private void addFunction(SelectorFunction<Node> function) {
    addFunction(Constants.NS_LMF_FUNCS + function.getPathExpression(null), function);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:4,代码来源:DefaultConfiguration.java

示例7: addTestFunction

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
private void addTestFunction(TestFunction<Node> test) {
    addTestFunction(Constants.NS_LMF_FUNCS + test.getLocalName(), test);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:4,代码来源:DefaultConfiguration.java

示例8: addFunction

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
/**
 * Add a mapping from a URI to a {@link SelectorFunction} implementation to the configuration.
 * Registered selector functions will be available under their URIs during program parsing.
 * Function calls are not thread safe and the order of function calls is not predictable;
 * they should therefore not hold any state.
 * <p/>
 * Example:<br/>
 * <code>fn:concat(...)</code> is a mapping from http://www.newmedialab.at/lmf/functions/1.0/ to an instance
 * of {@link org.apache.marmotta.ldpath.model.functions.ConcatenateFunction}
 * <p/>
 * Note that currently you can only use the http://www.newmedialab.at/lmf/functions/1.0/ namespace for
 * registering functions.
 *
 * @param uri      the URI under which to register the selector function as a string
 * @param function an instance of the selector function implementation to use for this URI
 */
public void addFunction(String uri, SelectorFunction<Node> function) {
    if(!uri.startsWith(Constants.NS_LMF_FUNCS)) {
        log.warn("Attempt to add a function from an external namespace: <{}>", uri);
        throw new IllegalArgumentException("namespaces other than http://www.newmedialab.at/lmf/functions/1.0/ are currently not supported");
    }
    functions.put(uri,function);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:24,代码来源:Configuration.java

示例9: addTestFunction

import org.apache.marmotta.ldpath.model.Constants; //导入依赖的package包/类
/**
 * Add a mapping from an URI to a {@link TestFunction} inplementation to the configuration.
 * Registered test functions will be available under their URIs during program parsing.
 * Function calls are not thread safe and the order of function calls in not predictable;
 * they should therefore not hold any state.
 * <p/>
 * Example:<br/>
 * <code>fn:eq(...)</code> is a mapping from http://www.newmedialab.at/lmf/functions/1.0/eq to an instance
 * of {@link EqualTest}
 * <p/>
 * Note that currently you can only use the http://www.newmedialab.at/lmf/functions/1.0/ namespace for
 * registering functions.
 * 
 * @param uri   the URI under which to register the selector function as a string
 * @param test  an instance of the test function implementation for this URI
 */
public void addTestFunction(String uri, TestFunction<Node> test) {
    if(!uri.startsWith(Constants.NS_LMF_FUNCS)) {
        log.warn("Attempt to add a test function from an external namespace: <{}>", uri);
        throw new IllegalArgumentException("namespaces other than http://www.newmedialab.at/lmf/functions/1.0/ are currently not supported");
    }
    testFunctions.put(uri,test);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:24,代码来源:Configuration.java


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