Description:
|
In ch.qos.logback.core.joran.util.PropertySetter
public AggregationType computeAggregationType(String name) {
String cName = capitalizeFirstLetter(name);
Method addMethod = findAdderMethod(cName);
// if the
if (addMethod != null) {
AggregationType type = computeRawAggregationType(addMethod);
switch (type) {
case NOT_FOUND:
return AggregationType.NOT_FOUND;
case AS_BASIC_PROPERTY:
return AggregationType.AS_BASIC_PROPERTY_COLLECTION;
case AS_COMPLEX_PROPERTY:
return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION;
}
}
Method setterMethod = findSetterMethod(name);
if (setterMethod != null) {
return computeRawAggregationType(setterMethod);
} else {
// we have failed
return AggregationType.NOT_FOUND;
}
}
The Aggregation types
AS_BASIC_PROPERTY_COLLECTION, // a collection of basic attributes
AS_COMPLEX_PROPERTY_COLLECTION; // a collection of complex attributes
are not covered.
If they cannot occur, suggesting
case AS_BASIC_PROPERTY_COLLECTION:
throw new Error("Cannot happen");
case AS_COMPLEX_PROPERTY_COLLECTION:
throw new Error("Cannot happen");
to placate fussy compilers.
|