/** {@inheritDoc} */ public XSBooleanValue isNilXSBoolean() { return new XSBooleanValue(Boolean.FALSE, false); }
protected String getStringValue(String key, SamlIdentityProviderDefinition definition, XMLObject xmlObject) { String value = null; if (xmlObject instanceof XSString) { value = ((XSString) xmlObject).getValue(); } else if (xmlObject instanceof XSAny) { value = ((XSAny)xmlObject).getTextContent(); } else if (xmlObject instanceof XSInteger) { Integer i = ((XSInteger)xmlObject).getValue(); value = i!=null ? i.toString() : null; } else if (xmlObject instanceof XSBoolean) { XSBooleanValue b = ((XSBoolean)xmlObject).getValue(); value = b!=null && b.getValue()!=null ? b.getValue().toString() : null; } else if (xmlObject instanceof XSDateTime) { DateTime d = ((XSDateTime)xmlObject).getValue(); value = d!=null ? d.toString() : null; } else if (xmlObject instanceof XSQName) { QName name = ((XSQName) xmlObject).getValue(); value = name!=null ? name.toString() : null; } else if (xmlObject instanceof XSURI) { value = ((XSURI) xmlObject).getValue(); } else if (xmlObject instanceof XSBase64Binary) { value = ((XSBase64Binary) xmlObject).getValue();
private void assertAttributeValue(List<Attribute> attributeList, String name, String... expectedValue) { for (Attribute attribute : attributeList) { if (attribute.getName().equals(name)) { List<XMLObject> xsString = attribute.getAttributeValues(); List<String> attributeValues = xsString.stream().map(xs -> ((XSString)xs).getValue()).collect(Collectors.toList()); assertThat(String.format("Attribute mismatch for '%s'.", name), attributeValues, containsInAnyOrder(expectedValue)); return; } } Assert.fail(String.format("No attribute value with name of '%s'.", name)); }
public Attribute buildStringAttribute(String name, List<String> values) { @SuppressWarnings("unchecked") SAMLObjectBuilder<Attribute> attributeBuilder = (SAMLObjectBuilder<Attribute>) builderFactory .getBuilder(Attribute.DEFAULT_ELEMENT_NAME); Attribute attribute = (Attribute) attributeBuilder.buildObject(); attribute.setName(name); @SuppressWarnings("unchecked") XMLObjectBuilder<XSString> xsStringBuilder = (XMLObjectBuilder<XSString>) builderFactory .getBuilder(XSString.TYPE_NAME); for (String value : values) { // Set custom Attributes XSString attributeValue = xsStringBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME); attributeValue.setValue(value); attribute.getAttributeValues().add(attributeValue); } return attribute; }
private String getString(XMLObject xmlValue) { if (xmlValue instanceof XSString) { return ((XSString) xmlValue).getValue(); } else if (xmlValue instanceof XSAny) { return ((XSAny) xmlValue).getTextContent(); } else { return null; } }
if ("XSURI".equals(name)) { XSURIImpl impl = new AttributedURIImpl("", "", ""); impl.setValue((String)value); xmlObjects.add(impl); } else if ("XSAny".equals(name)) { XSAnyImpl impl = new XSAnyImpl("","","") {}; impl.setTextContent((String)value); xmlObjects.add(impl); } else if ("XSQName".equals(name)) { XSQNameImpl impl = new XSQNameImpl("","","") {}; impl.setValue(new QName("", (String)value)); xmlObjects.add(impl); } else if ("XSInteger".equals(name)) { XSIntegerImpl impl = new XSIntegerImpl("","",""){}; impl.setValue((Integer)value); xmlObjects.add(impl); } else if ("XSBoolean".equals(name)) { XSBooleanImpl impl = new XSBooleanImpl("","",""){}; impl.setValue(new XSBooleanValue((Boolean)value, false)); xmlObjects.add(impl); } else if ("XSDateTime".equals(name)) { XSDateTimeImpl impl = new XSDateTimeImpl("","",""){}; impl.setValue((DateTime)value); xmlObjects.add(impl); } else if ("XSBase64Binary".equals(name)) { XSBase64BinaryImpl impl = new XSBase64BinaryImpl("","",""){}; impl.setValue((String)value); xmlObjects.add(impl); } else if (value instanceof List) {
/** {@inheritDoc} */ public Boolean isPassive() { if (isPassive != null) { return isPassive.getValue(); } return Boolean.FALSE; }
/** {@inheritDoc} */ protected void processElementContent(XMLObject xmlObject, String elementContent) { XSAny xsAny = (XSAny) xmlObject; xsAny.setTextContent(elementContent); } }
/** {@inheritDoc} */ protected void processElementContent(XMLObject xmlObject, String elementContent) { XSURI uri = (XSURI) xmlObject; uri.setValue(elementContent); } }
/** {@inheritDoc} */ protected void processElementContent(XMLObject xmlObject, String elementContent) { XSString xsiString = (XSString) xmlObject; xsiString.setValue(elementContent); } }
/** {@inheritDoc} */ public Boolean isInputContextOnly() { if (inputContextOnly != null) { return inputContextOnly.getValue(); } return Boolean.FALSE; }
/** {@inheritDoc} */ public Boolean isReturnContext() { if (returnContext != null) { return returnContext.getValue(); } return Boolean.FALSE; }
/** {@inheritDoc} */ public Boolean isSOAP11MustUnderstand() { if (soap11MustUnderstand != null) { return soap11MustUnderstand.getValue(); } return Boolean.FALSE; }
/** {@inheritDoc} */ public Boolean isSOAP11MustUnderstand() { if (soap11MustUnderstand != null) { return soap11MustUnderstand.getValue(); } return Boolean.FALSE; }
/** {@inheritDoc} */ public Boolean getRegexp() { if (regexp == null) { return Boolean.FALSE; } return regexp.getValue(); }
/** {@inheritDoc} */ public Boolean isSOAP11MustUnderstand() { if (soap11MustUnderstand != null) { return soap11MustUnderstand.getValue(); } return Boolean.FALSE; }
/** {@inheritDoc} */ public Boolean isForceAuthn() { if (forceAuthn != null) { return forceAuthn.getValue(); } return Boolean.FALSE; }
/** {@inheritDoc} */ public Boolean isCombinePolicies() { if (combinePolicies != null) { return combinePolicies.getValue(); } return Boolean.TRUE; }