• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Property类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getPropertyValue

import org.olap4j.metadata.Property; //导入依赖的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


示例2: getPropertyValue

import org.olap4j.metadata.Property; //导入依赖的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


示例3: getPropertyValue

import org.olap4j.metadata.Property; //导入依赖的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: populateCell

import org.olap4j.metadata.Property; //导入依赖的package包/类
private void populateCell(List<Row> rows) {
    for (Property.StandardCellProperty property
        : Property.StandardCellProperty.values())
    {
        Row row = new Row();
        row.set(
            PropertyType.name,
            Property.TypeFlag.getDictionary()
                .toMask(
                    property.getType()));
        row.set(PropertyName.name, property.name());
        row.set(PropertyCaption.name, property.getCaption());
        row.set(DataType.name, property.getDatatype().xmlaOrdinal());
        addRow(row, rows);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:17,代码来源:RowsetDefinition.java


示例5: populateLevel

import org.olap4j.metadata.Property; //导入依赖的package包/类
private void populateLevel(
    Catalog catalog,
    Cube cube,
    Level level,
    List<Row> rows)
    throws SQLException
{
    final XmlaHandler.XmlaExtra extra =
        getExtra(catalog.getMetaData().getConnection());
    for (Property property
        : filter(extra.getLevelProperties(level), propertyNameCond))
    {
        if (extra.isPropertyInternal(property)) {
            continue;
        }
        outputProperty(
            property, catalog, cube, level, rows);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:20,代码来源:RowsetDefinition.java


示例6: testFormatString

import org.olap4j.metadata.Property; //导入依赖的package包/类
public void testFormatString() throws SQLException {
    final OlapConnection connection =
        getTestContext().getOlap4jConnection();
    final CellSet cellSet =
        connection.createStatement().executeOlapQuery(
            "with member [Measures].[Foo] as 1, FORMAT_STRING = Iif(1 < 2, '##.0%', 'foo')\n"
            + "select\n"
            + " [Measures].[Foo] DIMENSION PROPERTIES FORMAT_EXP on 0\n"
            + "from [Sales]");
    final CellSetAxis axis = cellSet.getAxes().get(0);
    final Member member =
        axis.getPositions().get(0).getMembers().get(0);
    Property property = findProperty(axis, "FORMAT_EXP");
    assertNotNull(property);

    // Note that the expression is returned, unevaluated. You can tell from
    // the parentheses and quotes that it has been un-parsed.
    assertEquals(
        "IIf((1 < 2), \"##.0%\", \"foo\")",
        member.getPropertyValue(property));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:22,代码来源:Olap4jTest.java


示例7: testLevelProperties

import org.olap4j.metadata.Property; //导入依赖的package包/类
/**
 * Tests that a property that is not a standard olap4j property but is a
 * Mondrian-builtin property (viz, "FORMAT_EXP") is included among a level's
 * properties.
 *
 * @throws SQLException on error
 */
public void testLevelProperties() throws SQLException {
    final OlapConnection connection =
        getTestContext().getOlap4jConnection();
    final CellSet cellSet =
        connection.createStatement().executeOlapQuery(
            "select [Store].[Store Name].Members on 0\n"
            + "from [Sales]");
    final CellSetAxis axis = cellSet.getAxes().get(0);
    final Member member =
        axis.getPositions().get(0).getMembers().get(0);
    final NamedList<Property> properties =
        member.getLevel().getProperties();
    // UNIQUE_NAME is an olap4j standard property.
    assertNotNull(properties.get("MEMBER_UNIQUE_NAME"));
    // FORMAT_EXP is a Mondrian built-in but not olap4j standard property.
    assertNotNull(properties.get("FORMAT_EXP"));
    // [Store Type] is a property of the level.
    assertNotNull(properties.get("Store Type"));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:27,代码来源:Olap4jTest.java


示例8: testPropertyFormatter

import org.olap4j.metadata.Property; //导入依赖的package包/类
/**
 * Unit test for a property formatter defined in the old way -- a
 * 'formatter' attribute of a Property element.
 *
 * @throws java.sql.SQLException on error
 */
public void testPropertyFormatter() throws SQLException {
    TestContext tc = TestContext.instance().createSubstitutingCube(
        "Sales",
        "<Dimension name='Promotions2' foreignKey='promotion_id'>\n"
        + "  <Hierarchy hasAll='true' allMemberName='All Promotions' primaryKey='promotion_id' defaultMember='[All Promotions]'>\n"
        + "    <Table name='promotion'/>\n"
        + "    <Level name='Promotion Name' column='promotion_id' uniqueMembers='true'>\n"
        + "      <Property name='Medium' column='media_type' formatter='"
        + FooBarPropertyFormatter.class.getName()
        + "'/>\n"
        + "    </Level>\n"
        + "  </Hierarchy>\n"
        + "</Dimension>");
    final CellSet result =
        tc.executeOlap4jQuery(
            "select [Promotions2].Children on 0\n"
            + "from [Sales]");
    final org.olap4j.metadata.Member member =
        result.getAxes().get(0).getPositions().get(0).getMembers().get(0);
    final Property property = member.getProperties().get("Medium");
    assertEquals(
        "foo0/Medium/No Mediabar",
        member.getPropertyFormattedValue(property));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:31,代码来源:UdfTest.java


示例9: axisInfo

import org.olap4j.metadata.Property; //导入依赖的package包/类
private List<Hierarchy> axisInfo(SaxWriter writer, CellSetAxis axis, String axisName) {
   writer.startElement("AxisInfo", "name", axisName);

   List<Hierarchy> hierarchies;
   Iterator<org.olap4j.Position> it = axis.getPositions().iterator();
   if (it.hasNext()) {
      final org.olap4j.Position position = it.next();
      hierarchies = new ArrayList<Hierarchy>();
      for (Member member : position.getMembers()) {
         hierarchies.add(member.getHierarchy());
      }
   } else {
      hierarchies = axis.getAxisMetaData().getHierarchies();
   }
   List<Property> props = getProps(axis.getAxisMetaData());
   writeHierarchyInfo(writer, hierarchies, props);

   writer.endElement(); // AxisInfo

   return hierarchies;
}
 
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:22,代码来源:MDataSet.java


示例10: writeHierarchyInfo

import org.olap4j.metadata.Property; //导入依赖的package包/类
private void writeHierarchyInfo(SaxWriter writer, List<Hierarchy> hierarchies, List<Property> props) {
   writer.startSequence(null, "HierarchyInfo");
   for (Hierarchy hierarchy : hierarchies) {
      writer.startElement("HierarchyInfo", "name", "[" + hierarchy.getName() + "]");

      // exclude props "PARENT_UNIQUE_NAME" and "HIERARCHY_UNIQUE_NAME" by
      // exlcuding props[1]
      for (final Property prop : props) {
         if (!prop.getName().equals("PARENT_UNIQUE_NAME") && !prop.getName().equals("HIERARCHY_UNIQUE_NAME")) {
            final String encodedProp = encoder.encode(prop.getName());
            final Object[] attributes = getAttributes(prop, hierarchy);
            writer.element(encodedProp, attributes);
         }
      }
      writer.endElement(); // HierarchyInfo
   }
   writer.endSequence(); // "HierarchyInfo"
}
 
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:19,代码来源:MDataSet.java


示例11: populateImpl

import org.olap4j.metadata.Property; //导入依赖的package包/类
public void populateImpl(XmlaResponse response, OlapConnection connection, List<Row> rows) throws XmlaException, SQLException {
   // Default PROPERTY_TYPE is MDPROP_MEMBER.
   final List<String> list = (List<String>) restrictions.get(PropertyType.name);
   Set<Property.TypeFlag> typeFlags;
   if (list == null) {
      typeFlags = Olap4jUtil.enumSetOf(Property.TypeFlag.MEMBER);
   } else {
      typeFlags = Property.TypeFlag.getDictionary().forMask(Integer.valueOf(list.get(0)));
   }

   for (Property.TypeFlag typeFlag : typeFlags) {
      switch (typeFlag) {
      case MEMBER:
         populateMember(rows);
         break;
      case CELL:
         populateCell(rows);
         break;
      case SYSTEM:
      case BLOB:
      default:
         break;
      }
   }
}
 
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:26,代码来源:RowsetDefinition.java


示例12: MondrianOlap4jCellSetAxisMetaData

import org.olap4j.metadata.Property; //导入依赖的package包/类
/**
 * Creates a MondrianOlap4jCellSetAxisMetaData.
 *
 * @param cellSetMetaData Cell set axis metadata
 * @param queryAxis Query axis
 */
MondrianOlap4jCellSetAxisMetaData(
    MondrianOlap4jCellSetMetaData cellSetMetaData,
    QueryAxis queryAxis)
{
    if (queryAxis == null) {
        queryAxis = new QueryAxis(
            false, null, AxisOrdinal.StandardAxisOrdinal.SLICER,
            QueryAxis.SubtotalVisibility.Undefined);
    }
    this.queryAxis = queryAxis;
    this.cellSetMetaData = cellSetMetaData;

    // populate property list
    for (Id id : queryAxis.getDimensionProperties()) {
        propertyList.add(
            Property.StandardMemberProperty.valueOf(
                id.toStringArray()[0]));
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:26,代码来源:MondrianOlap4jCellSetAxisMetaData.java


示例13: getPropertyValue

import org.olap4j.metadata.Property; //导入依赖的package包/类
@Override
public Object getPropertyValue(Property property) {
	// VALUE FORMATTED_VALUE FORMAT_STRING 
	if(property==Property.StandardCellProperty.VALUE){
		return getValue();
	}else if(property==Property.StandardCellProperty.FORMATTED_VALUE){
		return getFormattedValue();
	}
	return null;
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:11,代码来源:ServerCell.java


示例14: populateImpl

import org.olap4j.metadata.Property; //导入依赖的package包/类
public void populateImpl(
    XmlaResponse response,
    OlapConnection connection,
    List<Row> rows)
    throws XmlaException, SQLException
{
    // Default PROPERTY_TYPE is MDPROP_MEMBER.
    @SuppressWarnings({"unchecked"})
    final List<String> list =
        (List<String>) restrictions.get(PropertyType.name);
    Set<Property.TypeFlag> typeFlags;
    if (list == null) {
        typeFlags =
            Olap4jUtil.enumSetOf(
                Property.TypeFlag.MEMBER);
    } else {
        typeFlags =
            Property.TypeFlag.getDictionary().forMask(
                Integer.valueOf(list.get(0)));
    }

    for (Property.TypeFlag typeFlag : typeFlags) {
        switch (typeFlag) {
        case MEMBER:
            populateMember(rows);
            break;
        case CELL:
            populateCell(rows);
            break;
        case SYSTEM:
        case BLOB:
        default:
            break;
        }
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:37,代码来源:RowsetDefinition.java


示例15: MondrianOlap4jCellSetAxisMetaData

import org.olap4j.metadata.Property; //导入依赖的package包/类
/**
 * Creates a MondrianOlap4jCellSetAxisMetaData.
 *
 * @param cellSetMetaData Cell set axis metadata
 * @param queryAxis Query axis
 */
MondrianOlap4jCellSetAxisMetaData(
    MondrianOlap4jCellSetMetaData cellSetMetaData,
    QueryAxis queryAxis)
{
    if (queryAxis == null) {
        queryAxis = new QueryAxis(
            false, null, AxisOrdinal.StandardAxisOrdinal.SLICER,
            QueryAxis.SubtotalVisibility.Undefined);
    }
    this.queryAxis = queryAxis;
    this.cellSetMetaData = cellSetMetaData;

    // populate property list
    for (Id id : queryAxis.getDimensionProperties()) {
        final String[] names = id.toStringArray();
        Property olap4jProperty = null;
        if (names.length == 1) {
            olap4jProperty =
                Util.lookup(
                    Property.StandardMemberProperty.class, names[0]);
            if (olap4jProperty == null) {
                olap4jProperty =
                    MondrianOlap4jProperty.MEMBER_EXTENSIONS.get(names[0]);
            }
        }
        if (olap4jProperty == null) {
            final UnresolvedFunCall call =
                (UnresolvedFunCall)
                    Util.lookup(
                        cellSetMetaData.query, id.getSegments(), true);
            Level level = ((LevelExpr) call.getArg(0)).getLevel();
            olap4jProperty =
                new MondrianOlap4jProperty(
                    Util.lookupProperty(level, call.getFunName()), level);
        }
        propertyList.add(olap4jProperty);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:45,代码来源:MondrianOlap4jCellSetAxisMetaData.java


示例16: findProperty

import org.olap4j.metadata.Property; //导入依赖的package包/类
private Property findProperty(CellSetAxis axis, String name) {
    for (Property property : axis.getAxisMetaData().getProperties()) {
        if (property.getName().equals(name)) {
            return property;
        }
    }
    return null;
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:9,代码来源:Olap4jTest.java


示例17: testCellProperties

import org.olap4j.metadata.Property; //导入依赖的package包/类
public void testCellProperties() throws SQLException {
    final OlapConnection connection =
        getTestContext().getOlap4jConnection();
    final CellSet cellSet =
        connection.createStatement().executeOlapQuery(
            "with member [Customers].[USA].[CA WA] as\n"
            + " Aggregate({[Customers].[USA].[CA], [Customers].[USA].[WA]})\n"
            + "select [Measures].[Unit Sales] on 0,\n"
            + " {[Customers].[USA].[CA], [Customers].[USA].[CA WA]} on 1\n"
            + "from [Sales]\n"
            + "cell properties ACTION_TYPE, DRILLTHROUGH_COUNT");
    final CellSetMetaData metaData = cellSet.getMetaData();
    final Property actionTypeProperty =
        metaData.getCellProperties().get("ACTION_TYPE");
    final Property drillthroughCountProperty =
        metaData.getCellProperties().get("DRILLTHROUGH_COUNT");

    // Cell [0, 0] is drillable
    final Cell cell0 = cellSet.getCell(0);
    final int actionType0 =
        (Integer) cell0.getPropertyValue(actionTypeProperty);
    assertEquals(0x100, actionType0); // MDACTION_TYPE_DRILLTHROUGH
    final int drill0 =
        (Integer) cell0.getPropertyValue(drillthroughCountProperty);
    assertEquals(24442, drill0);

    // Cell [0, 1] is not drillable
    final Cell cell1 = cellSet.getCell(1);
    final int actionType1 =
        (Integer) cell1.getPropertyValue(actionTypeProperty);
    assertEquals(0x0, actionType1);
    final int drill1 =
        (Integer) cell1.getPropertyValue(drillthroughCountProperty);
    assertEquals(-1, drill1);
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:36,代码来源:Olap4jTest.java


示例18: testPropertyFormatterNested

import org.olap4j.metadata.Property; //导入依赖的package包/类
/**
 * As {@link #testPropertyFormatter()}, but using new-style nested
 * PropertyFormatter element.
 *
 * @throws java.sql.SQLException on error
 */
public void testPropertyFormatterNested() throws SQLException {
    TestContext tc = TestContext.instance().createSubstitutingCube(
        "Sales",
        "<Dimension name='Promotions2' foreignKey='promotion_id'>\n"
        + "  <Hierarchy hasAll='true' allMemberName='All Promotions' primaryKey='promotion_id' defaultMember='[All Promotions]'>\n"
        + "    <Table name='promotion'/>\n"
        + "    <Level name='Promotion Name' column='promotion_id' uniqueMembers='true'>\n"
        + "      <Property name='Medium' column='media_type'>\n"
        + "        <PropertyFormatter className='"
        + FooBarPropertyFormatter.class.getName()
        + "'/>\n"
        + "      </Property>\n"
        + "    </Level>\n"
        + "  </Hierarchy>\n"
        + "</Dimension>");
    final CellSet result =
        tc.executeOlap4jQuery(
            "select [Promotions2].Children on 0\n"
            + "from [Sales]");
    final org.olap4j.metadata.Member member =
        result.getAxes().get(0).getPositions().get(0).getMembers().get(0);
    final Property property = member.getProperties().get("Medium");
    assertEquals(
        "foo0/Medium/No Mediabar",
        member.getPropertyFormattedValue(property));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:33,代码来源:UdfTest.java


示例19: testPropertyFormatterScript

import org.olap4j.metadata.Property; //导入依赖的package包/类
/**
 * As {@link #testPropertyFormatterNested()}, but using a script.
 *
 * @throws java.sql.SQLException on error
 */
public void testPropertyFormatterScript() throws SQLException {
    TestContext tc = TestContext.instance().createSubstitutingCube(
        "Sales",
        "<Dimension name='Promotions2' foreignKey='promotion_id'>\n"
        + "  <Hierarchy hasAll='true' allMemberName='All Promotions' primaryKey='promotion_id' defaultMember='[All Promotions]'>\n"
        + "    <Table name='promotion'/>\n"
        + "    <Level name='Promotion Name' column='promotion_id' uniqueMembers='true'>\n"
        + "      <Property name='Medium' column='media_type'>\n"
        + "        <PropertyFormatter>\n"
        + "          <Script language='JavaScript'>\n"
        + "            return \"foo\" + member.getName() + \"/\"\n"
        + "                   + propertyName + \"/\"\n"
        + "                   + propertyValue + \"bar\";\n"
        + "          </Script>\n"
        + "        </PropertyFormatter>\n"
        + "      </Property>\n"
        + "    </Level>\n"
        + "  </Hierarchy>\n"
        + "</Dimension>");
    final CellSet result =
        tc.executeOlap4jQuery(
            "select [Promotions2].Children on 0\n"
            + "from [Sales]");
    final org.olap4j.metadata.Member member =
        result.getAxes().get(0).getPositions().get(0).getMembers().get(0);
    final Property property = member.getProperties().get("Medium");
    assertEquals(
        "foo0/Medium/No Mediabar",
        member.getPropertyFormattedValue(property));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:36,代码来源:UdfTest.java


示例20: rename

import org.olap4j.metadata.Property; //导入依赖的package包/类
static Property rename(final Property property, final String name) {
   return new Property() {
      public Datatype getDatatype() {
         return property.getDatatype();
      }

      public Set<TypeFlag> getType() {
         return property.getType();
      }

      public ContentType getContentType() {

         return property.getContentType();
      }

      public String getName() {
         return name;
      }

      public String getUniqueName() {
         return property.getUniqueName();
      }

      public String getCaption() {
         return property.getCaption();
      }

      public String getDescription() {
         return property.getDescription();
      }

      public boolean isVisible() {
         return property.isVisible();
      }
   };
}
 
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:37,代码来源:MDataSet.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DelegationTokenExtension类代码示例发布时间:2022-05-23
下一篇:
Java XMLStreamException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap