コード例 #1
0
  /** {@inheritDoc} */
  protected void marshallElementContent(XMLObject samlObject, Element domElement)
      throws MarshallingException {
    Keywords words = (Keywords) samlObject;

    if (words.getKeywords() != null) {
      StringBuilder sb = new StringBuilder();
      for (String s : words.getKeywords()) {
        sb.append(s);
        sb.append(' ');
      }
      ElementSupport.appendTextContent(domElement, sb.toString());
    }
  }
コード例 #2
0
  /** {@inheritDoc} */
  protected void marshallAttributes(XMLObject samlObject, Element domElement)
      throws MarshallingException {
    Keywords words = (Keywords) samlObject;

    if (words.getXMLLang() != null) {
      Attr attribute =
          AttributeSupport.constructAttribute(
              domElement.getOwnerDocument(),
              XMLConstants.XML_NS,
              LangBearing.XML_LANG_ATTR_LOCAL_NAME,
              XMLConstants.XML_PREFIX);
      attribute.setValue(words.getXMLLang());
      domElement.setAttributeNodeNS(attribute);
    }
  }