/** * Checks if the given element is an EntitiesDescriptor. * * @param e element to check * * @return true if the element is an EntitiesDescriptor, false otherwise */ public static boolean isEntitiesDescriptor(@Nullable final Element e) { return ElementSupport.isElementNamed(e, ENTITIES_DESCRIPTOR_NAME); }
/** * Checks if the given element is an EntityDescriptor. * * @param e element to check * * @return true if the element is an EntityDescriptor, false otherwise */ public static boolean isEntityDescriptor(@Nullable final Element e) { return ElementSupport.isElementNamed(e, ENTITY_DESCRIPTOR_NAME); }
/** * Is this inside a <PolicyRequirementRule> or an permit or deny rule?. <br/> * This is used when parsing the various rules (<MatchFunctorType>) since the bean we summon up depends on * where we find ourselves. * * @param element the element under question * @return true if it is inside a policy requirement rule, false otherwise. */ protected boolean isPolicyRule(@Nonnull final Element element) { Element elem = element; do { if (ElementSupport.isElementNamed(elem, BaseFilterParser.POLICY_REQUIREMENT_RULE)) { return true; } else if (ElementSupport.isElementNamed(elem, BaseFilterParser.DENY_VALUE_RULE) || ElementSupport.isElementNamed(elem, BaseFilterParser.PERMIT_VALUE_RULE)) { return false; } elem = ElementSupport.getElementAncestor(elem); } while (elem != null); log.warn("Element '{}' : could not find schema defined parent"); return false; } }
if (ElementSupport.isElementNamed(scriptChild, element.getNamespaceURI(), "Script")) { builder.setFactoryMethod("inlineScript"); } else if (ElementSupport.isElementNamed(scriptChild, element.getNamespaceURI(), "ScriptFile")) { builder.setFactoryMethod("resourceScript");
final Element rootElement = getParserPool().parse(new StringReader(value)).getDocumentElement(); final Node messageElement = rootElement.getFirstChild(); if (!ElementSupport.isElementNamed(rootElement, null, "Mapping")) { throw new IOException("SAMLArtifactMapEntry XML not rooted by expected element"); } else if (messageElement == null || messageElement.getNodeType() != Node.ELEMENT_NODE) {
if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "AttributeFilterRef")) { builder.addPropertyReference("attributeFilter", ElementSupport.getElementContentAsString(child)); child = ElementSupport.getNextSiblingElement(child); } else if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "AttributeFilterScript")) { builder.addPropertyValue("attributeFilter", if (ElementSupport.isElementNamed(child, Attribute.DEFAULT_ELEMENT_NAME)) { try { final XMLObject attribute = unmarshaller.unmarshall(child); .isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "Entity")) { final BeanDefinitionBuilder entityIdBuilder = BeanDefinitionBuilder.genericBeanDefinition(EntityIdPredicate.class); forRule.addAll(accumulator); ruleMap.put(entityIdBuilder.getBeanDefinition(), forRule); } else if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "ConditionRef")) { final ManagedList<Attribute> forRule = new ManagedList(accumulator.size()); forRule.addAll(accumulator); ruleMap.put(new RuntimeBeanReference(ElementSupport.getElementContentAsString(child)), forRule); } else if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "ConditionScript")) { final ManagedList<Attribute> forRule = new ManagedList(accumulator.size());
/** {@inheritDoc} */ @Override protected void doParse(@Nonnull final Element config, @Nonnull final ParserContext parserContext, @Nonnull final BeanDefinitionBuilder builder) { super.doParse(config, parserContext, builder); DeprecationSupport.warnOnce(ObjectType.XSITYPE, DOMTypeSupport.getXSIType(config).toString(), parserContext.getReaderContext().getResource().getDescription(), "via NameID Generation Service configuration"); if (config.hasAttributeNS(null, "activationConditionRef")) { builder.addPropertyReference("activationCondition", StringSupport.trimOrNull(config.getAttributeNS(null, "activationConditionRef"))); } else { final Element child = ElementSupport.getFirstChildElement(config); if (child != null && ElementSupport.isElementNamed(child, AttributeResolverNamespaceHandler.NAMESPACE, "ActivationConditionScript")) { builder.addPropertyValue("activationCondition", ScriptTypeBeanParser.parseScriptType(ScriptedPredicate.class, child).getBeanDefinition()); } } if (config.hasAttributeNS(null, FORMAT_ATTRIBUTE_NAME)) { final String namespace = StringSupport.trimOrNull(config.getAttributeNS(null, FORMAT_ATTRIBUTE_NAME)); builder.addPropertyValue("nameFormat", namespace); } builder.setInitMethodName(null); builder.addPropertyValue("nameQualifier", StringSupport.trimOrNull(config.getAttributeNS(null, NAMEQUALIFIER_ATTRIBUTE_NAME))); }
if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "Format")) { accumulator.add(ElementSupport.getElementContentAsString(child)); } else if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "Entity")) { final BeanDefinitionBuilder entityIdBuilder = forRule.addAll(accumulator); ruleMap.put(entityIdBuilder.getBeanDefinition(), forRule); } else if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "ConditionRef")) { final ManagedList<String> forRule = new ManagedList(accumulator.size()); forRule.addAll(accumulator); ruleMap.put(new RuntimeBeanReference(ElementSupport.getElementContentAsString(child)), forRule); } else if (ElementSupport.isElementNamed(child, AbstractMetadataProviderParser.METADATA_NAMESPACE, "ConditionScript")) { final ManagedList<String> forRule = new ManagedList(accumulator.size());
/** {@inheritDoc} */ @Override protected void doParse(@Nonnull final Element config, @Nonnull final ParserContext parserContext, @Nonnull final BeanDefinitionBuilder builder) { super.doParse(config, parserContext, builder); DeprecationSupport.warnOnce(ObjectType.XSITYPE, DOMTypeSupport.getXSIType(config).toString(), parserContext.getReaderContext().getResource().getDescription(), "via NameID Generation Service configuration"); if (config.hasAttributeNS(null, "activationConditionRef")) { builder.addPropertyReference("activationCondition", StringSupport.trimOrNull(config.getAttributeNS(null, "activationConditionRef"))); } else { final Element child = ElementSupport.getFirstChildElement(config); if (child != null && ElementSupport.isElementNamed(child, AttributeResolverNamespaceHandler.NAMESPACE, "ActivationConditionScript")) { builder.addPropertyValue("activationCondition", ScriptTypeBeanParser.parseScriptType(ScriptedPredicate.class, child).getBeanDefinition()); } } if (config.hasAttributeNS(null, FORMAT_ATTRIBUTE_NAME)) { final String format = StringSupport.trimOrNull(config.getAttributeNS(null, FORMAT_ATTRIBUTE_NAME)); builder.addPropertyValue("nameFormat", format); } builder.setInitMethodName(null); builder.addPropertyValue("nameQualifier", StringSupport.trimOrNull(config.getAttributeNS(null, NAMEQUALIFIER_ATTRIBUTE_NAME))); }
} else { final Element child = ElementSupport.getFirstChildElement(config); if (child != null && ElementSupport.isElementNamed(child, AttributeResolverNamespaceHandler.NAMESPACE, "ActivationConditionScript")) { builder.addPropertyValue("activationCondition",