@Test public void testMakePropertyResourceName() { String actual = ConfigUtils.makePropertyResourceName( InputCollectorMappingProperties.class ); myLog.debug( "Received: " + actual ); Assert.assertEquals( "InputCollectorMapping.properties", actual ); actual = ConfigUtils.makePropertyResourceName( NonStandardNamedPropertiesDerivation.class ); myLog.debug( "Received: " + actual ); Assert.assertEquals( "NonStandardNamedPropertiesDerivation.properties", actual ); }
public static String makePropertyResourceName( Class<?> aClass ) { String found = null; SdiProps ann = aClass.getAnnotation( SdiProps.class ); if ( ann != null ) { found = ann.value(); } if ( StringUtils.hasText( found ) ) { if ( found.endsWith( ".properties" ) ) { return found; } return found + ".properties"; } String classname = aClass.getSimpleName(); if ( classname.endsWith( "Properties" ) || classname.endsWith( "properties" ) ) { return classname.substring( 0, classname.length() - "Properties".length() ) + ".properties"; } return classname + ".properties"; }
ConfigUtils { public static String makePropertyResourceName( Class<?> aClass ) { String found = null; SdiProps ann = aClass.getAnnotation( SdiProps.class ); if ( ann != null ) { found = ann.value(); } if ( StringUtils.hasText( found ) ) { if ( found.endsWith( ".properties" ) ) { return found; } return found + ".properties"; } String classname = aClass.getSimpleName(); if ( classname.endsWith( "Properties" ) || classname.endsWith( "properties" ) ) { return classname.substring( 0, classname.length() - "Properties".length() ) + ".properties"; } return classname + ".properties"; } }
ConfigUtils { public static String makePropertyResourceName( Class<?> aClass ) { String found = null; SdiProps ann = aClass.getAnnotation( SdiProps.class ); if ( ann != null ) { found = ann.value(); } if ( StringUtils.hasText( found ) ) { if ( found.endsWith( ".properties" ) ) { return found; } return found + ".properties"; } String classname = aClass.getSimpleName(); if ( classname.endsWith( "Properties" ) || classname.endsWith( "properties" ) ) { return classname.substring( 0, classname.length() - "Properties".length() ) + ".properties"; } return classname + ".properties"; }  }
ConfigUtils { public static String makePropertyResourceName( Class<?> aClass ) { String found = null; SdiProps ann = aClass.getAnnotation( SdiProps.class ); if ( ann != null ) { found = ann.value(); } if ( StringUtils.hasText( found ) ) { if ( found.endsWith( ".properties" ) ) { return found; } return found + ".properties"; } String classname = aClass.getSimpleName(); if ( classname.endsWith( "Properties" ) || classname.endsWith( "properties" ) ) { return classname.substring( 0, classname.length() - "Properties".length() ) + ".properties"; } return classname + ".properties"; }  static String makePropertyResourceName( Class<?> aClass ); static int getIntProperty( Environment aEnv, String aKey ); static int getIntProperty( Environment aEnv, String aKey, int aDefault ); static String getStringProperty( Environment aEnv,
                                            String aKey ); static boolean getBooleanProperty( Environment aEnv,
                                              String aKey ); static boolean getBooleanProperty( Environment aEnv,
                                              String aKey,
                                              boolean aDefault ); static void addToEnvironment( ConfigurableEnvironment aEnv,
                                         String aKey,
                                         Object aValue ); static void removeFromEnvironment( ConfigurableEnvironment aEnv,
                                              String aKey ); static Map<String, Object> getOrCreatePropertySource( ConfigurableEnvironment aEnv,
                                                                 String aPropertySourceName ); static void setConversionService( ConversionService aConversionService ); static Collection<String> getPropertyNamesStartingWith( ConfigurableEnvironment aEnv,
                                                                   String aKeyPrefix ); static Collection<String> getAllPropertyNames( ConfigurableEnvironment aEnv ); static Collection<String> getAllPropertyNames( PropertySource<?> aPropSource ); }
ConfigUtils { public static String makePropertyResourceName( Class<?> aClass ) { String found = null; SdiProps ann = aClass.getAnnotation( SdiProps.class ); if ( ann != null ) { found = ann.value(); } if ( StringUtils.hasText( found ) ) { if ( found.endsWith( ".properties" ) ) { return found; } return found + ".properties"; } String classname = aClass.getSimpleName(); if ( classname.endsWith( "Properties" ) || classname.endsWith( "properties" ) ) { return classname.substring( 0, classname.length() - "Properties".length() ) + ".properties"; } return classname + ".properties"; }  static String makePropertyResourceName( Class<?> aClass ); static int getIntProperty( Environment aEnv, String aKey ); static int getIntProperty( Environment aEnv, String aKey, int aDefault ); static String getStringProperty( Environment aEnv,
                                            String aKey ); static boolean getBooleanProperty( Environment aEnv,
                                              String aKey ); static boolean getBooleanProperty( Environment aEnv,
                                              String aKey,
                                              boolean aDefault ); static void addToEnvironment( ConfigurableEnvironment aEnv,
                                         String aKey,
                                         Object aValue ); static void removeFromEnvironment( ConfigurableEnvironment aEnv,
                                              String aKey ); static Map<String, Object> getOrCreatePropertySource( ConfigurableEnvironment aEnv,
                                                                 String aPropertySourceName ); static void setConversionService( ConversionService aConversionService ); static Collection<String> getPropertyNamesStartingWith( ConfigurableEnvironment aEnv,
                                                                   String aKeyPrefix ); static Collection<String> getAllPropertyNames( ConfigurableEnvironment aEnv ); static Collection<String> getAllPropertyNames( PropertySource<?> aPropSource ); static final String PROP_SOURCE_NAME_CMD_LINE; static final String KEY_PROP_OUTPUT_DIR; }