当前位置: 首页>>代码示例>>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;未经允许,请勿转载。