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

Java PropertyAccessException类代码示例

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

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



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

示例1: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(EventBean eventBean) throws PropertyAccessException {
    EventBean[] events = new EventBean[]{eventBean};

    int hashCode = 0;
    for (int i = 0; i < evaluators.length; i++) {
        Object result = evaluators[i].evaluate(events, true, null);
        if (result == null) {
            continue;
        }
        if (hashCode == 0) {
            hashCode = result.hashCode();
        } else {
            hashCode = 31 * hashCode + result.hashCode();
        }
    }

    if (hashCode >= 0) {
        return hashCode % granularity;
    }
    return -hashCode % granularity;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:22,代码来源:ContextControllerHashedGetterHashMultiple.java


示例2: testGet

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public void testGet() {
    assertEquals(eventType, eventBean.getEventType());
    assertEquals(testValues, eventBean.getUnderlying());

    assertEquals("test", eventBean.get("aString"));
    assertEquals(10, eventBean.get("anInt"));

    assertEquals("nestedValue", eventBean.get("myComplexBean.nested.nestedValue"));

    // test wrong property name
    try {
        eventBean.get("dummy");
        assertTrue(false);
    } catch (PropertyAccessException ex) {
        // Expected
        log.debug(".testGetter Expected exception, msg=" + ex.getMessage());
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:19,代码来源:TestObjectArrayEventBean.java


示例3: getMismatchException

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
private static PropertyAccessException getMismatchException(Class declared, Object object, ClassCastException e) {
    String classNameExpected = JavaClassHelper.getClassNameFullyQualPretty(declared);
    String classNameReceived;
    if (object != null) {
        classNameReceived = JavaClassHelper.getClassNameFullyQualPretty(object.getClass());
    } else {
        classNameReceived = "null";
    }

    if (classNameExpected.equals(classNameReceived)) {
        classNameExpected = JavaClassHelper.getClassNameFullyQualPrettyWithClassloader(declared);
        classNameReceived = object != null ? JavaClassHelper.getClassNameFullyQualPrettyWithClassloader(object.getClass()) : "null";
    }

    String message = "Mismatched getter instance to event bean type, expected " + classNameExpected + " but received " + classNameReceived;
    throw new PropertyAccessException(message, e);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:18,代码来源:PropertyUtility.java


示例4: evaluateXPathFragment

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public static Object evaluateXPathFragment(Object und, XPathExpression expression, String expressionText, String property, FragmentFactory fragmentFactory, QName resultType) {
    try {
        if (log.isDebugEnabled()) {
            log.debug("Running XPath '" + expressionText + "' for property '" + property + "' against Node XML :" + SchemaUtil.serialize((Node) und));
        }

        Object result = expression.evaluate(und, resultType);

        if (result instanceof Node) {
            return fragmentFactory.getEvent((Node) result);
        }

        if (result instanceof NodeList) {
            NodeList nodeList = (NodeList) result;
            EventBean[] events = new EventBean[nodeList.getLength()];
            for (int i = 0; i < events.length; i++) {
                events[i] = fragmentFactory.getEvent(nodeList.item(i));
            }
            return events;
        }

        log.warn("Error processing XPath property named '" + property + "' expression result is not of type Node or Nodeset");
        return null;
    } catch (XPathExpressionException e) {
        throw new PropertyAccessException("Error getting property " + property, e);
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:28,代码来源:XPathPropertyGetter.java


示例5: getRecordValueTopWPath

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
/**
 * NOTE: Code-generation-invoked method, method name and parameter order matters
 * @param record record
 * @param top top index
 * @param path path of indexes
 * @return value
 * @throws PropertyAccessException property access problem
 */
public static Object getRecordValueTopWPath(GenericData.Record record, int top, int[] path) throws PropertyAccessException {
    GenericData.Record inner = (GenericData.Record) record.get(top);
    if (inner == null) {
        return null;
    }
    for (int i = 0; i < path.length - 1; i++) {
        inner = (GenericData.Record) inner.get(path[i]);
        if (inner == null) {
            return null;
        }
    }
    return inner.get(path[path.length - 1]);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:22,代码来源:AvroEventBeanGetterNestedMultiLevel.java


示例6: getFragment

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object getFragment(EventBean eventBean) throws PropertyAccessException {
    if (fragmentEventType == null) {
        return null;
    }
    Object value = get(eventBean);
    if (value == null) {
        return null;
    }
    return eventAdapterService.adapterForTypedAvro(value, fragmentEventType);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:11,代码来源:AvroEventBeanGetterNestedMultiLevel.java


示例7: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(String property) throws PropertyAccessException {
    EventPropertyGetter getter = eventType.getGetter(property);
    if (getter == null) {
        throw new PropertyAccessException("Property named '" + property + "' is not a valid property name for this type");
    }
    return getter.get(this);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:BeanEventBean.java


示例8: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(String property) throws PropertyAccessException {
    EventPropertyGetter getter = revisionEventType.getGetter(property);
    if (getter == null) {
        return null;
    }
    return getter.get(this);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:RevisionEventBeanMerge.java


示例9: getFragment

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object getFragment(EventBean eventBean) throws PropertyAccessException {
    GenericData.Record record = (GenericData.Record) eventBean.getUnderlying();
    Collection values = (Collection) record.get(posTop);
    Object value = getAvroIndexedValue(values, index);
    if (value == null || !(value instanceof GenericData.Record)) {
        return null;
    }
    return nested.getAvroFragment((GenericData.Record) value);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:AvroEventBeanGetterNestedIndexRooted.java


示例10: getFragment

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object getFragment(EventBean eventBean) throws PropertyAccessException {
    if (fragmentType == null) {
        return null;
    }
    Object value = get(eventBean);
    if (value == null) {
        return null;
    }
    return eventAdapterService.adapterForTypedAvro(value, fragmentType);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:11,代码来源:AvroEventBeanGetterNestedSimple.java


示例11: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(String property) throws PropertyAccessException {
    EventPropertyGetter getter = eventType.getGetter(property);
    if (getter == null) {
        throw new PropertyAccessException("Property named '" + property + "' is not a valid property name for this type");
    }
    return eventType.getGetter(property).get(this);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:WrapperEventBean.java


示例12: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(EventBean eventBean) throws PropertyAccessException {
    Object value = VariantEventPropertyGetterAny.variantGet(eventBean, propertyGetterCache, assignedPropertyNumber);
    if (value == null) {
        return null;
    }
    return caster.cast(value);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:VariantEventPropertyGetterAnyWCast.java


示例13: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(EventBean eventBean) throws PropertyAccessException {
    RevisionEventBeanDeclared riv = (RevisionEventBeanDeclared) eventBean;
    MultiKeyUntyped key = (MultiKeyUntyped) riv.getKey();
    if (key == null) {
        return null;
    }
    return key.getKeys()[keyPropertyNumber];
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:VAERevisionEventPropertyGetterDeclaredNKey.java


示例14: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(EventBean eventBean) throws PropertyAccessException {
    GenericData.Record value = navigate((GenericData.Record) eventBean.getUnderlying());
    if (value == null) {
        return null;
    }
    return nested[nested.length - 1].getAvroFieldValue(value);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:AvroEventBeanGetterNestedIndexRootedMultilevel.java


示例15: getFragment

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object getFragment(EventBean eventBean) throws PropertyAccessException {
    GenericData.Record value = navigate((GenericData.Record) eventBean.getUnderlying());
    if (value == null) {
        return null;
    }
    return nested[nested.length - 1].getAvroFragment(value);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:AvroEventBeanGetterNestedIndexRootedMultilevel.java


示例16: testGet

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public void testGet() {
    assertEquals(bean.fieldStringArray[0], getter.get(theEvent));
    assertEquals(bean.fieldStringArray[0], getter.get(theEvent, 0));

    assertNull(getterOutOfBounds.get(theEvent));

    try {
        getter.get(SupportEventBeanFactory.createObject(""));
        fail();
    } catch (PropertyAccessException ex) {
        // expected
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:14,代码来源:TestArrayFieldPropertyGetter.java


示例17: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(EventBean eventBean) throws PropertyAccessException {
    RevisionEventBeanDeclared riv = (RevisionEventBeanDeclared) eventBean;
    EventBean bean = riv.getLastBaseEvent();
    if (bean == null) {
        return null;
    }
    return fullGetter.get(bean);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:VAERevisionEventPropertyGetterDeclaredLast.java


示例18: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(EventBean event, int index) throws PropertyAccessException {
    if (!(event instanceof DecoratingEventBean)) {
        throw new PropertyAccessException("Mismatched property getter to EventBean type");
    }
    DecoratingEventBean wrapper = (DecoratingEventBean) event;
    EventBean wrapped = wrapper.getUnderlyingEvent();
    if (wrapped == null) {
        return null;
    }
    return undIndexed.get(wrapped, index);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:12,代码来源:WrapperGetterIndexed.java


示例19: get

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object get(EventBean theEvent) {
    if (!(theEvent instanceof DecoratingEventBean)) {
        throw new PropertyAccessException("Mismatched property getter to EventBean type");
    }
    DecoratingEventBean wrapperEvent = (DecoratingEventBean) theEvent;
    Map map = wrapperEvent.getDecoratingProperties();
    return mapGetter.get(eventAdapterService.adapterForTypedMap(map, underlyingMapType));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:WrapperMapPropertyGetter.java


示例20: getFragment

import com.espertech.esper.client.PropertyAccessException; //导入依赖的package包/类
public Object getFragment(EventBean theEvent) {
    if (!(theEvent instanceof DecoratingEventBean)) {
        throw new PropertyAccessException("Mismatched property getter to EventBean type");
    }
    DecoratingEventBean wrapperEvent = (DecoratingEventBean) theEvent;
    Map map = wrapperEvent.getDecoratingProperties();
    return mapGetter.getFragment(eventAdapterService.adapterForTypedMap(map, underlyingMapType));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:WrapperMapPropertyGetter.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ReceiverSettleMode类代码示例发布时间:2022-05-23
下一篇:
Java AbstractEditPart类代码示例发布时间: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