/** * {@inheritDoc} */ @Override public String getParameterName( final int index ) { return _parameters.get( index ).name(); }
/** * {@inheritDoc} */ @Override public String getParameterName( final int index ) { return _parameters.get( index ).name(); }
@Override public Component getTableCellRendererComponent( final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column ) { final Component renderer = _delegate .getTableCellRendererComponent( table, value, isSelected, hasFocus, row, column ); if ( renderer instanceof JLabel && value instanceof ConfigurationParameter ) { ((JLabel)renderer).setText( ((ConfigurationParameter)value).name() ); } return renderer; }
public DefaultUserBit( final PipeBitInfo pipeBitInfo, final Class<?> pipeBitClass ) { _pipeBitInfo = pipeBitInfo; _pipeBitClass = pipeBitClass; _typeMap = ParameterMapper.createParameterTypeMap( pipeBitClass ); _parameterValues = ParameterMapper.createParameterDefaultsMap( pipeBitClass ); _parameters = new ArrayList<>( _typeMap.keySet() ); _parameters.sort( ( p1, p2 ) -> p1.name().compareToIgnoreCase( p2.name() ) ); }
/** * @param pipeBitClass - * @return annotated parameters for the class and all of its parent classes */ static private Collection<String> getParameterDescriptions( final Class<?> pipeBitClass ) { return getAllParameters( pipeBitClass ).stream() .map( p -> p.name() + " : " + p.description() ) .collect( Collectors.toList() ); }
/** * @param pipeBitClass - * @return annotated parameters for the class and all of its parent classes */ static private Collection<String> getParameterDescriptions( final Class<?> pipeBitClass ) { return getAllParameters( pipeBitClass ).stream() .map( p -> p.name() + " : " + p.description() ) .collect( Collectors.toList() ); }
private static List<Map<String, Object>> processParameters(Field field) { List<Map<String, Object>> parametersOutput = new ArrayList<>(); ConfigurationParameter[] parameters = field.getAnnotationsByType(ConfigurationParameter.class); for (ConfigurationParameter param : parameters) { if (ExternalResourceFactory.PARAM_RESOURCE_NAME.equals(param.name())) { continue; } Map<String, Object> parameterOutput = new HashMap<>(); parameterOutput.put("name", param.name()); parameterOutput.put("defaultValue", stringArrayToString(param.defaultValue())); parameterOutput.put("type", "parameter"); parametersOutput.add(parameterOutput); } return parametersOutput; }
private static List<Map<String, Object>> processParameters(Field field) { List<Map<String, Object>> parametersOutput = new ArrayList<>(); ConfigurationParameter[] parameters = field.getAnnotationsByType(ConfigurationParameter.class); for (ConfigurationParameter param : parameters) { if (ExternalResourceFactory.PARAM_RESOURCE_NAME.equals(param.name())) { continue; } Map<String, Object> parameterOutput = new HashMap<>(); parameterOutput.put("name", param.name()); parameterOutput.put("defaultValue", stringArrayToString(param.defaultValue())); parameterOutput.put("type", "parameter"); parametersOutput.add(parameterOutput); } return parametersOutput; }
/** * This method generates the default name of a configuration parameter that is defined by an * {@link org.apache.uima.fit.descriptor.ConfigurationParameter} annotation when no name is given * * @param field * the field to analyze * @return the parameter name */ public static String getConfigurationParameterName(Field field) { if (isConfigurationParameterField(field)) { org.apache.uima.fit.descriptor.ConfigurationParameter annotation = ReflectionUtil .getAnnotation(field, org.apache.uima.fit.descriptor.ConfigurationParameter.class); String name = annotation.name(); if (name.equals(org.apache.uima.fit.descriptor.ConfigurationParameter.USE_FIELD_NAME)) { name = field.getName(); } return name; } return null; }
ConfigurationParameter confParam = f .getAnnotation(ConfigurationParameter.class); paramNames.add(confParam.name());
if (ConfigurationParameterFactory.isConfigurationParameterField(field)) { org.apache.uima.fit.descriptor.ConfigurationParameter annotation = field.getAnnotation(org.apache.uima.fit.descriptor.ConfigurationParameter.class); String parameterName = annotation.name(); String expectedName = field.getName(); if (!expectedName.equals(parameterName)) {