/** * Checks whether the property with the given name is marked as updateable. * * @param propertyName * Name of the property to check * @return true if marked as updateable, else false. */ public boolean isPropertyUpdateable(final String propertyName) { final Plugin pluginAnnotations = this.getClass().getAnnotation(Plugin.class); final Property[] properties = pluginAnnotations.configuration(); final List<Property> propertyList = Arrays.asList(properties); for (final Property p : propertyList) { if (p.name().equals(propertyName)) { return p.updateable(); } } return false; }
/** * Checks whether the property with the given name is marked as updateable. * * @param propertyName * Name of the property to check * @return true if marked as updateable, else false. */ public boolean isPropertyUpdateable(final String propertyName) { final Plugin pluginAnnotations = this.getClass().getAnnotation(Plugin.class); final Property[] properties = pluginAnnotations.configuration(); final List<Property> propertyList = Arrays.asList(properties); for (final Property p : propertyList) { if (p.name().equals(propertyName)) { return p.updateable(); } } return false; }
/** * This method delivers an instance of {@code Configuration} containing the default properties for this class. * * @return The default properties. */ @Override protected final Configuration getDefaultConfiguration() { final Configuration defaultConfiguration = new Configuration(); // Get the annotation from the class final Repository repoAnnotation = this.getClass().getAnnotation(Repository.class); final Property[] propertyAnnotations = repoAnnotation.configuration(); // Run through all properties within the annotation and add them to the configuration object for (final Property property : propertyAnnotations) { defaultConfiguration.setProperty(property.name(), property.defaultValue()); } return defaultConfiguration; }
/** * This method provides the default properties, as supplied by the annotation. * * @return The default configuration. */ private final Configuration getDefaultConfiguration() { final Configuration defaultConfiguration = new Configuration(); // Get the (potential) annotation of our class final kieker.analysis.annotation.AnalysisController annotation = this.getClass().getAnnotation(kieker.analysis.annotation.AnalysisController.class); if (null != annotation) { // Run through the available properties and put them into our configuration for (final Property property : annotation.configuration()) { defaultConfiguration.setProperty(property.name(), property.defaultValue()); } } return defaultConfiguration; }
/** * This method delivers an instance of {@code Configuration} containing the default properties for this class. * * @return The default properties. */ @Override protected final Configuration getDefaultConfiguration() { final Configuration defaultConfiguration = new Configuration(); // Get the annotation from the class final Repository repoAnnotation = this.getClass().getAnnotation(Repository.class); final Property[] propertyAnnotations = repoAnnotation.configuration(); // Run through all properties within the annotation and add them to the configuration object for (final Property property : propertyAnnotations) { defaultConfiguration.setProperty(property.name(), property.defaultValue()); } return defaultConfiguration; }
/** * This method delivers an instance of {@code Configuration} containing the default properties for this class. * * @return The default properties. */ @Override protected final Configuration getDefaultConfiguration() { final Configuration defaultConfiguration = new Configuration(); // Get the annotation from the class final Plugin pluginAnnotation = this.getClass().getAnnotation(Plugin.class); final Property[] propertyAnnotations = pluginAnnotation.configuration(); // Run through all properties within the annotation and add them to the configuration object for (final Property property : propertyAnnotations) { defaultConfiguration.setProperty(property.name(), property.defaultValue()); } return defaultConfiguration; }
/** * This method delivers an instance of {@code Configuration} containing the default properties for this class. * * @return The default properties. */ @Override protected final Configuration getDefaultConfiguration() { final Configuration defaultConfiguration = new Configuration(); // Get the annotation from the class final Plugin pluginAnnotation = this.getClass().getAnnotation(Plugin.class); final Property[] propertyAnnotations = pluginAnnotation.configuration(); // Run through all properties within the annotation and add them to the configuration object for (final Property property : propertyAnnotations) { defaultConfiguration.setProperty(property.name(), property.defaultValue()); } return defaultConfiguration; }
/** * This method provides the default properties, as supplied by the annotation. * * @return The default configuration. */ private final Configuration getDefaultConfiguration() { final Configuration defaultConfiguration = new Configuration(); // Get the (potential) annotation of our class final kieker.analysis.annotation.AnalysisController annotation = this.getClass().getAnnotation(kieker.analysis.annotation.AnalysisController.class); if (null != annotation) { // Run through the available properties and put them into our configuration for (final Property property : annotation.configuration()) { defaultConfiguration.setProperty(property.name(), property.defaultValue()); } } return defaultConfiguration; }
possibleKeys.add(property.name());
possibleKeys.add(property.name());
private boolean isConfigurationCorrect(final Class<?> clazz) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { final IAnalysisController ac = new AnalysisController(); final AbstractPlugin pluginInstance = (AbstractPlugin) clazz.getConstructor(Configuration.class, IProjectContext.class).newInstance(new Configuration(), ac); final Property[] expectedProperties = this.getExpectedProperties(clazz); final Configuration actualConfiguration = this.getActualProperties(pluginInstance); for (final Property property : expectedProperties) { if (!(actualConfiguration.containsKey(property.name()))) { return false; } } return true; }