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


Java Mappings类代码示例

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


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

示例1: getQNameForClass

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
protected QName getQNameForClass(String clazz) {
    QName name = null;
    LOG.debug("Checking class to qname mappings for " + clazz);
    Mappings mappings = getClassToQnameMappings();
    if (mappings.getMapping() != null) {
        for (ClassToQname c2q : mappings.getMapping()) {
            if (c2q.getClassName().equals(clazz)) {
                name = QName.valueOf(c2q.getQname());
                LOG.debug("Found mapping");
                break;
            }
        }
    }
    if (name == null) {
        LOG.debug("QName not found in class to qname mappings, checking Axis types registry");
        try {
            name = Utils.getRegisteredQName(Class.forName(clazz));
        } catch (ClassNotFoundException e) {
            LOG.error("UNABLE TO LOAD CLASS " + clazz + " TO DETERMINE QNAME: " + e.getMessage(), e);
        }
    }
    if (name == null) {
        LOG.warn("Unable to determine a QName for class " + clazz);
    }
    return name;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:27,代码来源:BaseDataServiceImpl.java

示例2: processQuery

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
public CQLQueryResults processQuery(CQLQuery cqlQuery) throws MalformedQueryException, QueryProcessingException {
	List<?> results = getResultsList(cqlQuery);
	Mappings mapping = TestQueryResultsGenerator.getClassToQnameMappings();
	try {
		CQLQueryResults queryResults = CQLResultsCreationUtil.createObjectResults(results, cqlQuery.getTarget().getName(), mapping);
		return queryResults;
	} catch (ResultsCreationException ex) {
		throw new QueryProcessingException("Error creating result set: " + ex.getMessage(), ex);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:11,代码来源:TestingCQLQueryProcessor.java

示例3: getQname

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
private QName getQname(String targetClassname) {
    Mappings map = TestQueryResultsGenerator.getClassToQnameMappings();
    for (ClassToQname c2q : map.getMapping()) {
        if (c2q.getClassName().equals(targetClassname)) {
            return QName.valueOf(c2q.getQname());
        }
    }
    return null;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:10,代码来源:TestingCQL2QueryProcessor.java

示例4: getClassToQnameMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
public static Mappings getClassToQnameMappings() {
    Mappings mapping = new Mappings();
    ClassToQname bookMap = new ClassToQname();
    bookMap.setClassName(Book.class.getName());
    bookMap.setQname(new QName(BOOKSTORE_NAMESPACE, "Book").toString());
    ClassToQname storeMap = new ClassToQname();
    storeMap.setClassName(BookStore.class.getName());
    storeMap.setQname(new QName(BOOKSTORE_NAMESPACE, "BookStore").toString());
    mapping.setMapping(new ClassToQname[] {bookMap, storeMap});
    return mapping;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:12,代码来源:TestQueryResultsGenerator.java

示例5: getClassToQnameMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
private Mappings getClassToQnameMappings() throws Exception {
    if (mappings == null) {
        // get the mapping file name
        String filename = ServiceConfigUtil.getClassToQnameMappingsFile();
        mappings = Utils.deserializeDocument(filename, Mappings.class);
    }
    return mappings;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:9,代码来源:SDK42QueryProcessor.java

示例6: createObjectResults

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
/**
 * Creates a CQL Query Results object containing object results
 * 
 * @param objects
 * 		The objects to serialize and place in the object results
 * @param targetName
 * 		The name of the targeted class which produced these results
 * @param classToQname
 * 		A Mapping from class name to QName
 * @return
 * 		A CQLQueryResults instance with its object results populated
 * 
 * @throws ResultsCreationException
 */
public static CQLQueryResults createObjectResults(List objects, String targetName, Mappings classToQname) throws ResultsCreationException {
    CQLQueryResults results = new CQLQueryResults();
       results.setTargetClassname(targetName);
       QName targetQName = getQname(targetName, classToQname);
       List objectResults = new ArrayList();
       for (Iterator iter = objects.iterator(); iter.hasNext();) {
           MessageElement elem = new MessageElement(targetQName, iter.next());
           objectResults.add(new CQLObjectResult(new MessageElement[] {elem}));
       }
       CQLObjectResult[] objectResultArray = new CQLObjectResult[objectResults.size()];
       objectResults.toArray(objectResultArray);
       results.setObjectResult(objectResultArray);
       return results;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:29,代码来源:CQLResultsCreationUtil.java

示例7: getQname

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
private static QName getQname(String className, Mappings classMappings) {
	for (int i = 0; classMappings.getMapping() != null && i < classMappings.getMapping().length; i++) {
		if (classMappings.getMapping(i).getClassName().equals(className)) {
			return QName.valueOf(classMappings.getMapping(i).getQname());
		}
	}
	return null;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:9,代码来源:CQLResultsCreationUtil.java

示例8: initializeClassToQnameMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
private void initializeClassToQnameMappings() throws InitializationException {
    try {
        // get the mapping file name
        String filename = ServiceConfigUtil.getClassToQnameMappingsFile();
        // String filename = "mapping.xml";
        this.classToQnameMappings = (Mappings) Utils.deserializeDocument(filename, Mappings.class);
    } catch (Exception ex) {
        String message = "Error initializing class to QName mappings: " + ex.getMessage();
        LOG.error(message, ex);
        throw new InitializationException(message, ex);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:13,代码来源:SDK4QueryProcessor.java

示例9: getClassToQnameMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
private Mappings getClassToQnameMappings() throws Exception {
    // get the mapping file name
    String filename = ServiceConfigUtil.getClassToQnameMappingsFile();
    // String filename = "mapping.xml";
    Mappings mappings = (Mappings) Utils.deserializeDocument(filename, Mappings.class);
    return mappings;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:8,代码来源:SDK41QueryProcessor.java

示例10: getClassToQnameMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
/**
 * Get xml mappings.
 * @return xml mappings
 * @throws Exception on error
 */
protected Mappings getClassToQnameMappings() throws Exception {
    // get the mapping file name
    String filename = ServiceConfigUtil.getClassToQnameMappingsFile();
    Mappings mappings = (Mappings) Utils.deserializeDocument(filename, Mappings.class);
    return mappings;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:12,代码来源:CaArrayCQLQueryProcessor.java

示例11: initialize

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
/**
    * Used to inject a pre-existing Dataset Service and a custom security service.  This method 
    * is intended for testing purposes only.
    * @param parameters Properties passed to CQLQueryProcessor
    * @param wsdd WSDD file passed to CQLQueryProcessor
    * @param datasetService Used to configure Cql2SparqlProcessor
    * @throws InitializationException
    */
   public void initialize(DatasetService datasetService, GlobusSecurityService securitySvc, InputStream wsdd, Mappings classToQname) throws InitializationException {
super.initialize(getRequiredParameters(), wsdd) ;
anzo = new Anzo(datasetService) ;
if (!anzo.isConnected()) {
           throw new InitializationException("Error connecting to anzo.") ;
       }
       processor = new Cql2SparqlProcessor(anzo, getCvitMappers()) ;
       this.securitySvc = securitySvc ;
       this.classToQname = classToQname ;
   }
 
开发者ID:NCIP,项目名称:digital-model-repository,代码行数:19,代码来源:DmrQueryProcessor.java

示例12: MappingFileQNameResolver

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
public MappingFileQNameResolver(Mappings mappings) {
    this.mappings = mappings;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:4,代码来源:MappingFileQNameResolver.java

示例13: deserializeMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
public static Mappings deserializeMappings(File mappingsFile) throws Exception {
    FileReader reader = new FileReader(mappingsFile);
    Mappings map = Utils.deserializeObject(reader, Mappings.class);
    return map;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:MappingFileQNameResolver.java

示例14: getClassToQnameMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
protected Mappings getClassToQnameMappings() {
    return classToQnameMappings;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:4,代码来源:BaseDataServiceImpl.java

示例15: deserializeMappings

import gov.nih.nci.cagrid.data.mapping.Mappings; //导入依赖的package包/类
public static Mappings deserializeMappings(File mappingsFile) throws Exception {
    FileReader reader = new FileReader(mappingsFile);
    Mappings map = (Mappings) Utils.deserializeObject(reader, Mappings.class);
    return map;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:MappingFileQNameResolver.java


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