@Internal protected <R> Optional<R> findDefinedParagraphProperty(Function<CTTextParagraphProperties, Boolean> isSet, Function<CTTextParagraphProperties, R> getter, int level) { if (_body.isSetLstStyle() && level >= 0) { CTTextListStyle list = _body.getLstStyle(); CTTextParagraphProperties props = level == 0 ? list.getDefPPr() : retrieveProperties(list, level); if (props != null && isSet.apply(props)) { return Optional.of(getter.apply(props)); } else { return findDefinedParagraphProperty(isSet, getter, level - 1); } } else if (_parent != null) { return _parent.findDefinedParagraphProperty(isSet, getter); } else { return Optional.empty(); } }
@Internal protected <R> Optional<R> findDefinedRunProperty(Function<CTTextCharacterProperties, Boolean> isSet, Function<CTTextCharacterProperties, R> getter, int level) { if (_body.isSetLstStyle() && level >= 0) { CTTextListStyle list = _body.getLstStyle(); CTTextParagraphProperties props = level == 0 ? list.getDefPPr() : retrieveProperties(list, level); if (props != null && props.isSetDefRPr() && isSet.apply(props.getDefRPr())) { return Optional.of(getter.apply(props.getDefRPr())); } else { return findDefinedRunProperty(isSet, getter, level - 1); } } else if (_parent != null) { return _parent.findDefinedRunProperty(isSet, getter); } else { return Optional.empty(); } }
@Internal protected <R> Optional<R> findDefinedParagraphProperty(Function<CTTextParagraphProperties, Boolean> isSet, Function<CTTextParagraphProperties, R> getter, int level) { if (_body.isSetLstStyle() && level >= 0) { CTTextListStyle list = _body.getLstStyle(); CTTextParagraphProperties props = level == 0 ? list.getDefPPr() : retrieveProperties(list, level); if (props != null && isSet.apply(props)) { return Optional.of(getter.apply(props)); } else { return findDefinedParagraphProperty(isSet, getter, level - 1); } } else if (_parent != null) { return _parent.findDefinedParagraphProperty(isSet, getter); } else { return Optional.empty(); } }
@Internal protected <R> Optional<R> findDefinedRunProperty(Function<CTTextCharacterProperties, Boolean> isSet, Function<CTTextCharacterProperties, R> getter, int level) { if (_body.isSetLstStyle() && level >= 0) { CTTextListStyle list = _body.getLstStyle(); CTTextParagraphProperties props = level == 0 ? list.getDefPPr() : retrieveProperties(list, level); if (props != null && props.isSetDefRPr() && isSet.apply(props.getDefRPr())) { return Optional.of(getter.apply(props.getDefRPr())); } else { return findDefinedRunProperty(isSet, getter, level - 1); } } else if (_parent != null) { return _parent.findDefinedRunProperty(isSet, getter); } else { return Optional.empty(); } }