org.opensaml.xml.schema.XSAny.getUnknownXMLObjects()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中org.opensaml.xml.schema.XSAny.getUnknownXMLObjects()方法的一些代码示例,展示了XSAny.getUnknownXMLObjects()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSAny.getUnknownXMLObjects()方法的具体详情如下:
包路径:org.opensaml.xml.schema.XSAny
类名称:XSAny
方法名:getUnknownXMLObjects

XSAny.getUnknownXMLObjects介绍

暂无

代码示例

代码示例来源:origin: org.opensaml/xmltooling

/** {@inheritDoc} */
protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
    throws UnmarshallingException {
  XSAny xsAny = (XSAny) parentXMLObject;
  xsAny.getUnknownXMLObjects().add(childXMLObject);
}

代码示例来源:origin: io.apigee.opensaml/xmltooling

/** {@inheritDoc} */
protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
    throws UnmarshallingException {
  XSAny xsAny = (XSAny) parentXMLObject;
  xsAny.getUnknownXMLObjects().add(childXMLObject);
}

代码示例来源:origin: stackoverflow.com

public XSAny createXSAny(Element dom)
{
XSAnyBuilder anyBuilder = (XSAnyBuilder) Configuration.getBuilderFactory().getBuilder(XSAny.TYPE_NAME);
  XSAny any = anyBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSAny.TYPE_NAME);
  // this builds only the root element not the whole dom
  XSAny xo=anyBuilder.buildObject(dom);
  // set/populate dom so whole dom gets into picture
  xo.setDOM(dom);
  any.getUnknownXMLObjects().add(xo);

 return any; 
}

代码示例来源:origin: OpenConext/Mujina

public static Optional<String> getStringValueFromXMLObject(XMLObject xmlObj) {
 if (xmlObj instanceof XSString) {
  return Optional.ofNullable(((XSString) xmlObj).getValue());
 } else if (xmlObj instanceof XSAny) {
  XSAny xsAny = (XSAny) xmlObj;
  String textContent = xsAny.getTextContent();
  if (StringUtils.hasText(textContent)) {
   return Optional.of(textContent);
  }
  List<XMLObject> unknownXMLObjects = xsAny.getUnknownXMLObjects();
  if (!CollectionUtils.isEmpty(unknownXMLObjects)) {
   XMLObject xmlObject = unknownXMLObjects.get(0);
   if (xmlObject instanceof NameID) {
    NameID nameID = (NameID) xmlObject;
    return Optional.of(nameID.getValue());
   }
  }
 }
 return Optional.empty();
}

代码示例来源:origin: usnistgov/iheos-toolkit2

if (AttributeValue.DEFAULT_ELEMENT_LOCAL_NAME.equals(ep.getElementQName().getLocalPart())
    && SAMLConstants.SAML20_NS.equals(ep.getElementQName().getNamespaceURI())) {
  if (ep.getUnknownXMLObjects().size() > 0) {
    StringBuilder res = new StringBuilder();
    for (XMLObject obj : ep.getUnknownXMLObjects()) {
      res.append(XMLHelper.nodeToString(SamlUtil.marshallObject(obj)));

代码示例来源:origin: usnistgov/iheos-toolkit2

if (AttributeValue.DEFAULT_ELEMENT_LOCAL_NAME.equals(ep.getElementQName().getLocalPart())
    && SAMLConstants.SAML20_NS.equals(ep.getElementQName().getNamespaceURI())) {
  if (ep.getUnknownXMLObjects().size() > 0) {
    StringBuilder res = new StringBuilder();
    for (XMLObject obj : ep.getUnknownXMLObjects()) {
      res.append(XMLHelper.nodeToString(SamlUtil.marshallObject(obj)));

代码示例来源:origin: usnistgov/iheos-toolkit2

if (AttributeValue.DEFAULT_ELEMENT_LOCAL_NAME.equals(ep.getElementQName().getLocalPart())
    && SAMLConstants.SAML20_NS.equals(ep.getElementQName().getNamespaceURI())) {
  if (ep.getUnknownXMLObjects().size() > 0) {
    StringBuilder res = new StringBuilder();
    for (XMLObject obj : ep.getUnknownXMLObjects()) {
      res.append(XMLHelper.nodeToString(marshallObject(obj)));

代码示例来源:origin: usnistgov/iheos-toolkit2

if (AttributeValue.DEFAULT_ELEMENT_LOCAL_NAME.equals(ep.getElementQName().getLocalPart())
    && SAMLConstants.SAML20_NS.equals(ep.getElementQName().getNamespaceURI())) {
  if (ep.getUnknownXMLObjects().size() > 0) {
    StringBuilder res = new StringBuilder();
    for (XMLObject obj : ep.getUnknownXMLObjects()) {
      res.append(XMLHelper.nodeToString(SamlUtil.marshallObject(obj)));

代码示例来源:origin: edu.internet2.middleware/shibboleth-common

/** {@inheritDoc} */
public Attribute encode(BaseAttribute attribute) throws AttributeEncodingException {
  Attribute samlAttribute = attributeBuilder.buildObject();
  populateAttribute(samlAttribute);
  XSAny samlAttributeValue;
  for (Object o : attribute.getValues()) {
    if (o == null || !(o instanceof XMLObject)) {
      continue;
    }
    samlAttributeValue = attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME);
    samlAttributeValue.getUnknownXMLObjects().add((XMLObject) o);
    samlAttribute.getAttributeValues().add(samlAttributeValue);
  }
  List<XMLObject> attributeValues = samlAttribute.getAttributeValues();
  if (attributeValues == null || attributeValues.isEmpty()) {
    log.debug("Unable to encode {} attribute.  It does not contain any values", attribute.getId());
    return null;
  }
  return samlAttribute;
}

代码示例来源:origin: edu.internet2.middleware/shibboleth-common

/** {@inheritDoc} */
public Attribute encode(BaseAttribute attribute) throws AttributeEncodingException {
  Attribute samlAttribute = attributeBuilder.buildObject();
  populateAttribute(samlAttribute);
  XSAny samlAttributeValue;
  for (Object o : attribute.getValues()) {
    if (o == null || !(o instanceof XMLObject)) {
      continue;
    }
    samlAttributeValue = attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME);
    samlAttributeValue.getUnknownXMLObjects().add((XMLObject) o);
    samlAttribute.getAttributeValues().add(samlAttributeValue);
  }
  List<XMLObject> attributeValues = samlAttribute.getAttributeValues();
  if (attributeValues == null || attributeValues.isEmpty()) {
    log.debug("Unable to encode {} attribute.  It does not contain any values", attribute.getId());
    return null;
  }
  return samlAttribute;
}

代码示例来源:origin: edu.internet2.middleware/shibboleth-common

} else if (xmlObj instanceof XSAny) {
  final XSAny wc = (XSAny) xmlObj;
  if (wc.getUnknownAttributes().isEmpty() && wc.getUnknownXMLObjects().isEmpty()) {
    toMatch = wc.getTextContent();

相关文章