當前位置: 首頁>>代碼示例>>Java>>正文


Java GivenName類代碼示例

本文整理匯總了Java中org.opensaml.saml2.metadata.GivenName的典型用法代碼示例。如果您正苦於以下問題:Java GivenName類的具體用法?Java GivenName怎麽用?Java GivenName使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GivenName類屬於org.opensaml.saml2.metadata包,在下文中一共展示了GivenName類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processChildElement

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    ContactPerson person = (ContactPerson) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        person.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Company) {
        person.setCompany((Company) childSAMLObject);
    } else if (childSAMLObject instanceof GivenName) {
        person.setGivenName((GivenName) childSAMLObject);
    } else if (childSAMLObject instanceof SurName) {
        person.setSurName((SurName) childSAMLObject);
    } else if (childSAMLObject instanceof EmailAddress) {
        person.getEmailAddresses().add((EmailAddress) childSAMLObject);
    } else if (childSAMLObject instanceof TelephoneNumber) {
        person.getTelephoneNumbers().add((TelephoneNumber) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:22,代碼來源:ContactPersonUnmarshaller.java

示例2: marshallElementContent

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
    GivenName name = (GivenName) samlObject;

    if (name.getName() != null) {
        XMLHelper.appendTextContent(domElement, name.getName());
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:GivenNameMarshaller.java

示例3: testNameFailure

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/**
 * Tests for Name failure.
 * 
 * @throws ValidationException
 */
public void testNameFailure() throws ValidationException {
    GivenName givenName = (GivenName) target;

    givenName.setName(null);
    assertValidationFail("Name was null, should raise a Validation Exception.");

    givenName.setName("");
    assertValidationFail("Name was empty string, should raise a Validation Exception.");

    givenName.setName("   ");
    assertValidationFail("Name was white space, should raise a Validation Exception.");
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:18,代碼來源:GivenNameSchemaTest.java

示例4: testSingleElementMarshall

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
public void testSingleElementMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME);
    GivenName name = (GivenName) buildXMLObject(qname);
    
    name.setName(expectName);

    assertEquals(expectedDOM, name);
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:10,代碼來源:GivenNameTest.java

示例5: testChildElementsMarshall

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
public void testChildElementsMarshall()
{
    QName qname = new QName(SAMLConstants.SAML20MD_NS, ContactPerson.DEFAULT_ELEMENT_LOCAL_NAME);
    ContactPerson person = (ContactPerson) buildXMLObject(qname);
    
    person.setType(expectedPersonType);

    QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setExtensions((Extensions) buildXMLObject(extensionsQName));
    
    QName companuQName = new QName(SAMLConstants.SAML20MD_NS, Company.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setCompany((Company) buildXMLObject(companuQName));
    
    QName givenNameQName = new QName(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setGivenName((GivenName) buildXMLObject(givenNameQName));
    
    QName surnameQName = new QName(SAMLConstants.SAML20MD_NS, SurName.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setSurName((SurName) buildXMLObject(surnameQName));
    
    QName teleQName = new QName(SAMLConstants.SAML20MD_NS, TelephoneNumber.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < telephoneNumberCount; i++) {
        person.getTelephoneNumbers().add((TelephoneNumber) buildXMLObject(teleQName));
    }
    
    QName emailQName = new QName(SAMLConstants.SAML20MD_NS, EmailAddress.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < emailAddressCount; i++) {
        person.getEmailAddresses().add((EmailAddress) buildXMLObject(emailQName));
    }
    
    assertEquals(expectedChildElementsDOM, person);
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:33,代碼來源:ContactPersonTest.java

示例6: validate

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
public void validate(GivenName givenName) throws ValidationException {
    validateName(givenName);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:5,代碼來源:GivenNameSchemaValidator.java

示例7: buildObject

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
public GivenName buildObject() {
    return buildObject(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:5,代碼來源:GivenNameBuilder.java

示例8: getGivenName

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
public GivenName getGivenName() {
    return givenName;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:5,代碼來源:ContactPersonImpl.java

示例9: setGivenName

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
public void setGivenName(GivenName name) {
    givenName = prepareForAssignment(givenName, name);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:5,代碼來源:ContactPersonImpl.java

示例10: processElementContent

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
protected void processElementContent(XMLObject samlObject, String elementContent) {
    GivenName name = (GivenName) samlObject;

    name.setName(elementContent);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:GivenNameUnmarshaller.java

示例11: GivenNameMarshaller

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/**
 * Constructor
 */
public GivenNameMarshaller() {
    super(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:7,代碼來源:GivenNameMarshaller.java

示例12: GivenNameUnmarshaller

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/**
 * Constructor
 */
public GivenNameUnmarshaller() {
    super(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:7,代碼來源:GivenNameUnmarshaller.java

示例13: GivenNameSchemaTest

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** Constructor */
public GivenNameSchemaTest() {
    targetQName = new QName(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    validator = new GivenNameSchemaValidator();
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:7,代碼來源:GivenNameSchemaTest.java

示例14: populateRequiredData

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    GivenName givenName = (GivenName) target;
    givenName.setName("name");
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:7,代碼來源:GivenNameSchemaTest.java

示例15: testSingleElementUnmarshall

import org.opensaml.saml2.metadata.GivenName; //導入依賴的package包/類
/** {@inheritDoc} */
public void testSingleElementUnmarshall() {
    GivenName name = (GivenName) unmarshallElement(singleElementFile);
    
    assertEquals("Name was not expected value", expectName, name.getName());
}
 
開發者ID:apigee,項目名稱:java-opensaml2,代碼行數:7,代碼來源:GivenNameTest.java


注:本文中的org.opensaml.saml2.metadata.GivenName類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。