You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "Leschke, Scott" <SL...@medline.com> on 2017/06/30 20:30:26 UTC

Configuration Types

@ObjectClassDefinition(name = "My Configuration")
public @interface MyConfig
{
     EnumType myEnumType();
}

Given a a configuration interface type that has an enumeration result, I've noticed that if the associated value in the .cfg file has trailing whitespace, the conversion to the enum fails. Although I haven't tried it, I'm guessing that numeric conversions will fail as well.

Even though java properties aren't right trimmed, which has never made sense to me, I think in these cases, they should be prior to attempting the conversion.

Scott