in src/main/java/org/apache/sling/xss/impl/xml/Property.java [53:76]
public Property(
@JacksonXmlProperty(localName = "name", isAttribute = true) String name,
@JacksonXmlProperty(localName = "regexp") List<Regexp> allowedRegexps,
@JacksonXmlProperty(localName = "literal") List<Literal> literalList,
@JacksonXmlProperty(localName = "shorthand") List<Shorthand> shortHandRefs,
@JacksonXmlProperty(localName = "description", isAttribute = true) String description,
@JacksonXmlProperty(localName = "onInvalid", isAttribute = true) String onInvalidStr,
@JacksonXmlProperty(isAttribute = true, localName = "default") String defaultValue) {
this.name = name.toLowerCase(AntiSamyConfigLocale.REGION);
this.description = Optional.ofNullable(description).orElse("");
this.onInvalid =
onInvalid != null && onInvalid.length() > 0 ? onInvalid : AntiSamyActions.REMOVE_ATTRIBUTE_ON_INVALID;
this.regexpList = Optional.ofNullable(allowedRegexps)
.map(Collections::unmodifiableList)
.orElseGet(Collections::emptyList);
this.literalList = Optional.ofNullable(literalList)
.map(Collections::unmodifiableList)
.orElseGet(Collections::emptyList);
this.shorthandList = Optional.ofNullable(shortHandRefs)
.map(Collections::unmodifiableList)
.orElseGet(Collections::emptyList);
this.defaultValue = defaultValue;
}