/** * {@inheritDoc} */ @Override public String[] getParameterValue( final int index ) { return _parameters.get( index ).defaultValue(); }
/** * @param pipeBitClass - * @return Configuration Parameters and default values for the Pipe Bit and all of its parent classes */ static public Map<ConfigurationParameter, String[]> createParameterDefaultsMap( final Class<?> pipeBitClass ) { final Map<ConfigurationParameter, String[]> parameterMap = new HashMap<>(); final Collection<Class<?>> inheritables = new ArrayList<>(); final Class<?>[] interfaces = pipeBitClass.getInterfaces(); if ( interfaces != null && interfaces.length > 0 ) { inheritables.addAll( Arrays.asList( interfaces ) ); } if ( pipeBitClass.getSuperclass() != null ) { inheritables.add( pipeBitClass.getSuperclass() ); } inheritables.stream().map( ParameterMapper::createParameterDefaultsMap ).forEach( parameterMap::putAll ); final Field[] fields = pipeBitClass.getDeclaredFields(); Arrays.stream( fields ) .map( f -> f.getAnnotation( ConfigurationParameter.class ) ) .filter( Objects::nonNull ) .forEach( cp -> parameterMap.put( cp, cp.defaultValue() ) ); return parameterMap; }
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; }
.getAnnotation(field, org.apache.uima.fit.descriptor.ConfigurationParameter.class); String[] stringValue = annotation.defaultValue(); if (stringValue.length == 1 && stringValue[0]
final String[] value = values.get( i ); if ( value != null && value.length > 0 && !Arrays.equals( value, holder.getParameter( i ).defaultValue() ) ) { helpSb.append( "# " ).append( holder.getParameterName( i ) ) .append( " " ).append( holder.getParameterDescription( i ) ).append( "\n" );