Package com.espertech.esper.client

Examples of com.espertech.esper.client.EventPropertyGetter


        Property lastProperty = null;
        for (Iterator<Property> it = properties.iterator(); it.hasNext();)
        {
            Property property = it.next();
            lastProperty = property;
            EventPropertyGetter getter = property.getGetter(eventType, eventAdapterService);
            if (getter == null)
            {
                return null;
            }
View Full Code Here


        {
            count++;
            Property property = it.next();

            // manufacture a getter for getting the item out of the map
            EventPropertyGetter getter = property.getGetterMap(currentDictionary, eventAdapterService);
            if (getter == null)
            {
                return null;
            }
            getters.add(getter);

            PropertyBase base = (PropertyBase) property;
            String propertyName = base.getPropertyNameAtomic();

            // For the next property if there is one, check how to property type is defined
            if (!it.hasNext())
            {
                continue;
            }

            if (currentDictionary != null)
            {
                // check the type that this property will return
                Object propertyReturnType = currentDictionary.get(propertyName);

                if (propertyReturnType == null)
                {
                    currentDictionary = null;
                }
                if (propertyReturnType != null)
                {
                    if (propertyReturnType instanceof Map)
                    {
                        currentDictionary = (Map) propertyReturnType;
                    }
                    else if (propertyReturnType == Map.class)
                    {
                        currentDictionary = null;
                    }
                    else if (propertyReturnType instanceof String)
                    {
                        String nestedName = propertyReturnType.toString();
                        boolean isArray = EventTypeUtility.isPropertyArray(nestedName);
                        if (isArray) {
                            nestedName = EventTypeUtility.getPropertyRemoveArray(nestedName);
                        }

                        EventType innerType = eventAdapterService.getExistsTypeByName(nestedName);
                        if (innerType == null)
                        {
                            return null;
                        }

                        String remainingProps = toPropertyEPL(properties, count);
                        EventPropertyGetter getterInner = innerType.getGetter(remainingProps);
                        if (getterInner == null) {
                            return null;
                        }

                        getters.add(getterInner);
                        break; // the single Pojo getter handles the rest
                    }
                    else if (propertyReturnType instanceof EventType)
                    {
                        EventType innerType = (EventType) propertyReturnType;
                        String remainingProps = toPropertyEPL(properties, count);
                        EventPropertyGetter getterInner = innerType.getGetter(remainingProps);
                        if (getterInner == null) {
                            return null;
                        }

                        getters.add(getterInner);
                        break; // the single Pojo getter handles the rest
                    }
                    else
                    {
                        // treat the return type of the map property as a POJO
                        Class pojoClass = (Class) propertyReturnType;
                        if (!pojoClass.isArray())
                        {
                            BeanEventType beanType = eventAdapterService.getBeanEventTypeFactory().createBeanType(pojoClass.getName(), pojoClass, false, false, false);
                            String remainingProps = toPropertyEPL(properties, count);
                            EventPropertyGetter getterInner = beanType.getGetter(remainingProps);
                            if (getterInner == null) {
                                return null;
                            }
                            getters.add(getterInner);
                            break; // the single Pojo getter handles the rest
                        }
                        else
                        {
                            Class componentType = pojoClass.getComponentType();
                            BeanEventType beanType = eventAdapterService.getBeanEventTypeFactory().createBeanType(componentType.getName(), componentType, false, false, false);
                            String remainingProps = toPropertyEPL(properties, count);
                            EventPropertyGetter getterInner = beanType.getGetter(remainingProps);
                            if (getterInner == null) {
                                return null;
                            }
                            getters.add(getterInner);
                            break; // the single Pojo getter handles the rest
View Full Code Here

        List<EventPropertyGetter> getters = new LinkedList<EventPropertyGetter>();

        for (Iterator<Property> it = properties.iterator(); it.hasNext();)
        {
            Property property = it.next();
            EventPropertyGetter getter = property.getGetterDOM();
            if (getter == null)
            {
                return null;
            }
View Full Code Here

        SchemaElementComplex complexElement = parentComplexProperty;

        for (Iterator<Property> it = properties.iterator(); it.hasNext();)
        {
            Property property = it.next();
            EventPropertyGetter getter = property.getGetterDOM(complexElement, eventAdapterService, eventType, propertyExpression);
            if (getter == null)
            {
                return null;
            }
View Full Code Here

    }

    public ExprIdentNodeImpl(EventType eventType, String propertyName, int streamNumber) {
        unresolvedPropertyName = propertyName;
        resolvedPropertyName = propertyName;
        EventPropertyGetter propertyGetter = eventType.getGetter(propertyName);
        if (propertyGetter == null) {
            throw new IllegalArgumentException("Ident-node constructor could not locate property " + propertyName);
        }
        Class propertyType = eventType.getPropertyType(propertyName);
        evaluator = new ExprIdentNodeEvaluatorImpl(streamNumber, propertyGetter, propertyType);
View Full Code Here

        Pair<PropertyResolutionDescriptor, String> propertyInfoPair = ExprIdentNodeUtil.getTypeFromStream(validationContext.getStreamTypeService(), unresolvedPropertyName, streamOrPropertyName);
        resolvedStreamName = propertyInfoPair.getSecond();
        int streamNum = propertyInfoPair.getFirst().getStreamNum();
        Class propertyType = propertyInfoPair.getFirst().getPropertyType();
        resolvedPropertyName = propertyInfoPair.getFirst().getPropertyName();
        EventPropertyGetter propertyGetter = propertyInfoPair.getFirst().getStreamEventType().getGetter(resolvedPropertyName);

        if (propertyGetter == null)
        {
            throw new ExprValidationException("Property getter returned was invalid for property '" + unresolvedPropertyName + "'");
        }
View Full Code Here

            // Resolve directly as fragment event type if possible
            if (atom.getSplitterExpression() instanceof ExprIdentNode) {
                String propertyName = ((ExprIdentNode) atom.getSplitterExpression()).getFullUnresolvedName();
                fragmentEventType = currentEventType.getFragmentType(propertyName);
                if (fragmentEventType != null) {
                    EventPropertyGetter getter = currentEventType.getGetter(propertyName);
                    if (getter != null) {
                        containedEventEval = new ContainedEventEvalGetter(getter);
                        expressionText = propertyName;
                        streamEventType = fragmentEventType.getFragmentType();
                    }
View Full Code Here

        return revisionEventType;
    }

    public Object get(String property) throws PropertyAccessException
    {
        EventPropertyGetter getter = revisionEventType.getGetter(property);
        if (getter == null)
        {
            return null;
        }
        return getter.get(this);
    }
View Full Code Here

            {
                return value.getObject();
            }
        }

        EventPropertyGetter getter = params.getBaseGetter();
        if (getter == null)
        {
            return null// The property was added by a delta event and only exists on a delta
        }
        return getter.get(lastBaseEvent);
    }
View Full Code Here

        return getter.get(lastBaseEvent);
    }

    public Object getFragment(String propertyExpression)
    {
        EventPropertyGetter getter = revisionEventType.getGetter(propertyExpression);
        if (getter == null)
        {
            return null;
        }
        return getter.getFragment(this);
    }
View Full Code Here

TOP

Related Classes of com.espertech.esper.client.EventPropertyGetter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.