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


Java OlapException类代码示例

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


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

示例1: render

import org.olap4j.OlapException; //导入依赖的package包/类
public Expression render(AggregateTable table) throws OlapException {
	
	VelocityContext context = new VelocityContext();
	for(TableMeasure m : table.measures){
		if(m.getExpression()!=null)
			context.put(m.measure.replace(" ", "_"), m.getExpression().toString());
	}
	
	StringWriter w = new StringWriter();

	try{
		ve.evaluate(context, w, "render", this.formula);
	}catch(Exception ex){
		throw new OlapException("Fail to parse formula "+formula + ": "+ ex.getMessage(), ex);
	}
	
	return new CustomExpression(w.toString());
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:19,代码来源:Formula.java

示例2: getPropertyValue

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Object getPropertyValue(Property property) throws OlapException {
	if(property==Property.StandardMemberProperty.$visible){
		return new Boolean(isVisible());
	}else if(property==Property.StandardMemberProperty.CHILDREN_CARDINALITY){
		return 0;
	}else if(property==Property.StandardCellProperty.DATATYPE){
		return "String";
	}else if(property==Property.StandardMemberProperty.MEMBER_UNIQUE_NAME){
		return getUniqueName();
	}else if(property==Property.StandardMemberProperty.MEMBER_CAPTION){
		return getCaption();
	}else if(property==Property.StandardMemberProperty.LEVEL_UNIQUE_NAME){
		return getLevel().getUniqueName();
	}else if(property==Property.StandardMemberProperty.LEVEL_NUMBER){
		return getLevel().getDepth();
	}else{
		return null;
	}	}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:20,代码来源:LevelMember.java

示例3: getPropertyValue

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Object getPropertyValue(Property property) throws OlapException {
	if(property==Property.StandardMemberProperty.$visible){
		return new Boolean(isVisible());
	}else if(property==Property.StandardMemberProperty.CHILDREN_CARDINALITY){
		return 0;
	}else if(property==Property.StandardCellProperty.DATATYPE){
		return "String";
	}else if(property==Property.StandardMemberProperty.MEMBER_UNIQUE_NAME){
		return getUniqueName();
	}else if(property==Property.StandardMemberProperty.MEMBER_CAPTION){
		return getCaption();
	}else if(property==Property.StandardMemberProperty.LEVEL_UNIQUE_NAME){
		return getLevel().getUniqueName();
	}else if(property==Property.StandardMemberProperty.LEVEL_NUMBER){
		return getLevel().getDepth();
	}else{
		return null;
	}	
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:21,代码来源:ServerHierarchy.java

示例4: getPropertyValue

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Object getPropertyValue(Property property) throws OlapException {
	if(property==Property.StandardMemberProperty.$visible){
		return new Boolean(isVisible());
	}else if(property==Property.StandardMemberProperty.CHILDREN_CARDINALITY){
		return 0;
	}else if(property==Property.StandardCellProperty.DATATYPE){
		return definition.datatype;
	}else if(property==Property.StandardMemberProperty.MEMBER_UNIQUE_NAME){
		return getUniqueName();
	}else if(property==Property.StandardMemberProperty.MEMBER_CAPTION){
		return getCaption();
	}else if(property==Property.StandardMemberProperty.LEVEL_UNIQUE_NAME){
		return getLevel().getUniqueName();
	}else if(property==Property.StandardMemberProperty.LEVEL_NUMBER){
		return getLevel().getDepth();
	}else{
		return null;
	}
	
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:22,代码来源:ServerMeasure.java

示例5: getPhysicalSchema

import org.olap4j.OlapException; //导入依赖的package包/类
public PhysicalSchema getPhysicalSchema() throws OlapException {
	if(schema==null){			
		try{
			schema = ResourceLoader.read(physical_schema, PhysicalSchema.class);		
			schema.index(this);
		}catch(Exception ex){
			throw new OlapException("Fail to read physical schema: "+ex.getMessage(), ex);
		}
	}
	return schema;
	
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:13,代码来源:CatalogDefinition.java

示例6: collectAllUsedMeasures

import org.olap4j.OlapException; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public Set<ServerMeasure> collectAllUsedMeasures() throws OlapException{
	
	Set measures = new HashSet();
	for(LevelMemberSet layer : layers){
		if(layer.isMeasure()){
			measures.addAll(layer.getMembers());
		}
		measures.addAll(layer.getFunction().getAllMeasuresUsed());
	}
	
	return measures;
	
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:15,代码来源:ResultAxis.java

示例7: process

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public void process(ResultSet result) throws SQLException, OlapException {
	members = new ArrayList<Member>();
	while(result.next()){
		
		String key = result.getString(ID_ALIAS);
		String name = result.getString(NAME_ALIAS);
		
		members.add(new LevelMember(level, key, name, members.size()));
		
	}
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:13,代码来源:SqlMembersQuery.java

示例8: getConnection

import org.olap4j.OlapException; //导入依赖的package包/类
public Connection getConnection() throws OlapException{
	try {
		return dataSource.getConnection();
	} catch (SQLException e) {
		throw new OlapException("Fail to get connection", e);
	}		
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:8,代码来源:SqlConnector.java

示例9: memberSet

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public List<LevelMemberSet> memberSet() throws OlapException {

	Level level = MetadataUtils.lookupLevel(cube, node.getSegmentList());
	if(level==null)
		throw new OlapException("Level not found in cube: "+ParseUtils.toString(node));
	
	return Collections.singletonList(new LevelMemberSet(level, node, this));
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:10,代码来源:MembersFunction.java

示例10: getCatalogs

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public NamedList<Catalog> getCatalogs() throws OlapException {
	
	NamedList<Catalog> list = MetadataUtils.catalogNamedList(new ArrayList<Catalog>());
    for(CatalogDefinition cdef: definition.catalogs){
    	list.add(new ServerCatalog(this, cdef));
    }

	return list;
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:11,代码来源:ServerDatabase.java

示例11: getMeasures

import org.olap4j.OlapException; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List<Measure> getMeasures() {
	if(measures!=null)
		return measures;
        
   try {
	   return (List)measureDimension.getDefaultHierarchy().getLevels().get(0).getMembers();
   } catch (OlapException e) {
	   return null;
   }
	
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:14,代码来源:ServerCube.java

示例12: getOlapOp

import org.olap4j.OlapException; //导入依赖的package包/类
protected OlapOp getOlapOp(ParseTreeNode op_node, String name, Cube cube)
		throws OlapException {
	
	Class c = functionMap.get(name.toLowerCase());
	if(c==null)
		return null;
	try {
		Constructor cons = c.getConstructor(new Class[]{op_node.getClass(), Cube.class});
		return (OlapOp) cons.newInstance(op_node, cube);
	} catch (Exception e) {
		throw new RuntimeException("Fail to run function "+name, e);
	}
	
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:15,代码来源:OlapFunctionFactory.java

示例13: getAllMeasuresUsed

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Collection<ServerMeasure> getAllMeasuresUsed() throws OlapException {
	if(node instanceof CallNode){
		Set<ServerMeasure> result = new HashSet<ServerMeasure>();
		for(IdentifierNode inode : ParseUtils.getAllIdentifiers((CallNode) node)){
			Member m = cube.lookupMember(inode.getSegmentList());
			if(m instanceof ServerMeasure)
				result.add((ServerMeasure) m);
		}
		return result;
	}else
		return Collections.emptyList();
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:14,代码来源:OlapFunction.java

示例14: readHierarchies

import org.olap4j.OlapException; //导入依赖的package包/类
private void readHierarchies() throws OlapException {
	
	hierarchies = MetadataUtils.metadataNamedList(new ArrayList<Hierarchy>());  
	
	Map<String, AttributeDefinition> attributeMap = new HashMap<String, AttributeDefinition>();
	
    if(definition.attributes!=null)        
    for(AttributeDefinition cdef: definition.attributes){
    	attributeMap.put(cdef.name, cdef);
    	if(cdef.auto_hierarchy){
    		hierarchies.add(new ServerHierarchy(this, cdef,  Collections.singletonList((NamedElement)cdef)));
    	}
    }
    
    if(definition.hierarchies!=null)
    for(HierarchyDefinition hdef : definition.hierarchies){
    	
    	List<NamedElement> levelDefs = new ArrayList<NamedElement>();
    	for(String level : hdef.levels){	
    		AttributeDefinition attr_def = attributeMap.get(level);
    		if(attr_def==null)
    			throw new OlapException("Fail to find attribute "+level+" used in dimension "+ getName());
    		levelDefs.add(attr_def);
    	}
    	
    	hierarchies.add(new ServerHierarchy(this, hdef, levelDefs));
    }
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:29,代码来源:ServerDimension.java

示例15: getCubes

import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public NamedList<Cube> getCubes() throws OlapException {
	
	NamedList<Cube> list = MetadataUtils.metadataNamedList(new ArrayList<Cube>());
	
   for(CubeDefinition def : definition.cubes){
	   list.add(new ServerCube(this, def));  
   }

   return list;
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:12,代码来源:ServerSchema.java


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