Package com.espertech.esper.event

Examples of com.espertech.esper.event.WriteablePropertyDescriptor


            if (writeMethod == null)
            {
                continue;
            }

            result.add(new WriteablePropertyDescriptor(propertyName, writeMethod.getParameterTypes()[0], writeMethod));
        }
    }
View Full Code Here


            if (propertyName.toLowerCase().equals(CLASS_PROPERTY_NAME)) {
                continue;
            }

            // use the writeable property descriptor (appropriate setter method) from writing the property
            WriteablePropertyDescriptor descriptor = findDescriptor(applicableClass, propertyName, writables);
            if (descriptor != null) {
                Object coerceProperty = coerceProperty(propertyName, applicableClass, property.getValue(), descriptor.getType(), engineImportService, false);

                try {
                    descriptor.getWriteMethod().invoke(top, new Object[] {coerceProperty});
                }
                catch (IllegalArgumentException e) {
                    throw new ExprValidationException("Illegal argument invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName() + " provided value " + coerceProperty, e);
                }
                catch (IllegalAccessException e) {
                    throw new ExprValidationException("Illegal access invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName(), e);
                }
                catch (InvocationTargetException e) {
                    throw new ExprValidationException("Exception invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName() + ": " + e.getTargetException().getMessage(), e);
                }
                continue;
            }

            // find the field annotated with {@link @GraphOpProperty}
View Full Code Here

        List<WriteablePropertyDescriptor> writablesList = new ArrayList<WriteablePropertyDescriptor>();

        for (int i = 0; i < propertyNamesOffered.length; i++) {
            String propertyName = propertyNamesOffered[i];
            WriteablePropertyDescriptor writable = EventTypeUtility.findWritable(propertyName, writeables);
            if (writable == null) {
                throw new ExprValidationException("Failed to find writable property '" + propertyName + "' for event type '" + outputEventType.getName() + "'");
            }
            writablesList.add(writable);
        }
View Full Code Here

            }

            Set<WriteablePropertyDescriptor> writeables = context.getStatementContext().getEventAdapterService().getWriteableProperties(outputEventType);
            List<WriteablePropertyDescriptor> writeableList = new ArrayList<WriteablePropertyDescriptor>();

            WriteablePropertyDescriptor writeableLine = EventTypeUtility.findWritable(propertyNameLineToUse, writeables);
            if (writeableLine == null) {
                throw new EPException("Failed to find writable property property '" + propertyNameLineToUse + "', is the property read-only?");
            }
            writeableList.add(writeableLine);

            if (propertyNameFile != null) {
                WriteablePropertyDescriptor writeableFile = EventTypeUtility.findWritable(propertyNameFile, writeables);
                if (writeableFile == null || writeableFile.getType() != String.class) {
                    throw new EPException("Failed to find writable String-type property '" + propertyNameFile + "', is the property read-only?");
                }
                writeableList.add(writeableFile);
            }
View Full Code Here

        EventType portEventType = context.getOutputPorts().get(outputPort).getOptionalDeclaredType().getEventType();
        Set<WriteablePropertyDescriptor> writeables = context.getStatementContext().getEventAdapterService().getWriteableProperties(portEventType);
        List<WriteablePropertyDescriptor> writeableList = new ArrayList<WriteablePropertyDescriptor>();
        EventBeanManufacturer manufacturer;
        if (propertyNameFile != null) {
            WriteablePropertyDescriptor writeableFile = EventTypeUtility.findWritable(propertyNameFile, writeables);
            if (writeableFile == null || writeableFile.getType() != String.class) {
                throw new EPException("Failed to find writable String-type property '" + propertyNameFile + "', is the property read-only?");
            }
            writeableList.add(writeableFile);
        }
        try {
View Full Code Here

            }
            if (propertyType == null) {
                continue;
            }
            SimpleTypeParser parser = SimpleTypeParserFactory.getParser(propertyType);
            WriteablePropertyDescriptor writable = EventTypeUtility.findWritable(propertyName, writeables);
            if (writable == null) {
                continue;
            }
            indexesList.add(i);
            parserList.add(parser);
View Full Code Here

            if (propertyName.toLowerCase().equals(CLASS_PROPERTY_NAME)) {
                continue;
            }

            // use the writeable property descriptor (appropriate setter method) from writing the property
            WriteablePropertyDescriptor descriptor = findDescriptor(applicableClass, propertyName, writables);
            if (descriptor != null) {
                Object coerceProperty = coerceProperty(propertyName, applicableClass, property.getValue(), descriptor.getType(), engineImportService, false);

                try {
                    descriptor.getWriteMethod().invoke(top, new Object[] {coerceProperty});
                }
                catch (IllegalArgumentException e) {
                    throw new ExprValidationException("Illegal argument invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName() + " provided value " + coerceProperty, e);
                }
                catch (IllegalAccessException e) {
                    throw new ExprValidationException("Illegal access invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName(), e);
                }
                catch (InvocationTargetException e) {
                    throw new ExprValidationException("Exception invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName() + ": " + e.getTargetException().getMessage(), e);
                }
                continue;
            }

            // find the field annotated with {@link @GraphOpProperty}
View Full Code Here

        List<WriteablePropertyDescriptor> writablesList = new ArrayList<WriteablePropertyDescriptor>();

        for (int i = 0; i < propertyNamesOffered.length; i++) {
            String propertyName = propertyNamesOffered[i];
            WriteablePropertyDescriptor writable = EventTypeUtility.findWritable(propertyName, writeables);
            if (writable == null) {
                throw new ExprValidationException("Failed to find writable property '" + propertyName + "' for event type '" + outputEventType.getName() + "'");
            }
            writablesList.add(writable);
        }
View Full Code Here

            if (writeMethod == null)
            {
                continue;
            }

            result.add(new WriteablePropertyDescriptor(propertyName, writeMethod.getParameterTypes()[0], writeMethod));
        }
    }
View Full Code Here

            if (propertyName.toLowerCase().equals(CLASS_PROPERTY_NAME)) {
                continue;
            }

            // use the writeable property descriptor (appropriate setter method) from writing the property
            WriteablePropertyDescriptor descriptor = findDescriptor(applicableClass, propertyName, writables);
            if (descriptor != null) {
                Object coerceProperty = coerceProperty(propertyName, applicableClass, property.getValue(), descriptor.getType(), engineImportService, false);

                try {
                    descriptor.getWriteMethod().invoke(top, new Object[] {coerceProperty});
                }
                catch (IllegalArgumentException e) {
                    throw new ExprValidationException("Illegal argument invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName() + " provided value " + coerceProperty, e);
                }
                catch (IllegalAccessException e) {
                    throw new ExprValidationException("Illegal access invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName(), e);
                }
                catch (InvocationTargetException e) {
                    throw new ExprValidationException("Exception invoking setter method for property '" + propertyName + "' for class " + applicableClass.getName() + " method " + descriptor.getWriteMethod().getName() + ": " + e.getTargetException().getMessage(), e);
                }
                continue;
            }

            // find the field annotated with {@link @GraphOpProperty}
View Full Code Here

TOP

Related Classes of com.espertech.esper.event.WriteablePropertyDescriptor

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.