Skip to content

Commit

Permalink
more internal changes and refactorings
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Feb 28, 2024
1 parent 8f3a304 commit 231e9bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ public class ModelConstants {
public static final String INVALID_ATTRIBUTES = "In <property> element, either the \"file\" attribute alone, or "
+ "the \"resource\" element alone, or both the \"name\" and \"value\" attributes must be set.";

}
public static final String PARENT_PROPPERTY_KEY = "parent";
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import ch.qos.logback.core.model.ComponentModel;
import ch.qos.logback.core.model.ImplicitModel;
import ch.qos.logback.core.model.Model;
import ch.qos.logback.core.model.ModelConstants;
import ch.qos.logback.core.spi.ContextAware;
import ch.qos.logback.core.spi.LifeCycle;
import ch.qos.logback.core.util.AggregationType;
Expand All @@ -33,8 +34,7 @@ public class ImplicitModelHandler extends ModelHandlerBase {

private final BeanDescriptionCache beanDescriptionCache;
private ImplicitModelData implicitModelData;

static final String PARENT_PROPPERTY_KEY = "parent";

static public final String IGNORING_UNKNOWN_PROP = "Ignoring unknown property";

boolean inError = false;
Expand Down Expand Up @@ -196,8 +196,8 @@ private void postHandleComplex(ModelInterpretationContext mic, Model model,
nestedBean.setContext(context);

// have the nested element point to its parent if possible
if (nestedBean.computeAggregationType(PARENT_PROPPERTY_KEY) == AggregationType.AS_COMPLEX_PROPERTY) {
nestedBean.setComplexProperty(PARENT_PROPPERTY_KEY, imdComplex.parentBean.getObj());
if (nestedBean.computeAggregationType(ModelConstants.PARENT_PROPPERTY_KEY) == AggregationType.AS_COMPLEX_PROPERTY) {
nestedBean.setComplexProperty(ModelConstants.PARENT_PROPPERTY_KEY, imdComplex.parentBean.getObj());
}

// start the nested complex property if it implements LifeCycle and is not
Expand Down

0 comments on commit 231e9bd

Please sign in to comment.