本文整理汇总了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);
}
}
示例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());
}
}
示例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.");
}
示例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);
}
示例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);
}
示例6: validate
import org.opensaml.saml2.metadata.GivenName; //导入依赖的package包/类
/** {@inheritDoc} */
public void validate(GivenName givenName) throws ValidationException {
validateName(givenName);
}
示例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);
}
示例8: getGivenName
import org.opensaml.saml2.metadata.GivenName; //导入依赖的package包/类
/** {@inheritDoc} */
public GivenName getGivenName() {
return givenName;
}
示例9: setGivenName
import org.opensaml.saml2.metadata.GivenName; //导入依赖的package包/类
/** {@inheritDoc} */
public void setGivenName(GivenName name) {
givenName = prepareForAssignment(givenName, name);
}
示例10: processElementContent
import org.opensaml.saml2.metadata.GivenName; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processElementContent(XMLObject samlObject, String elementContent) {
GivenName name = (GivenName) samlObject;
name.setName(elementContent);
}
示例11: GivenNameMarshaller
import org.opensaml.saml2.metadata.GivenName; //导入依赖的package包/类
/**
* Constructor
*/
public GivenNameMarshaller() {
super(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME);
}
示例12: GivenNameUnmarshaller
import org.opensaml.saml2.metadata.GivenName; //导入依赖的package包/类
/**
* Constructor
*/
public GivenNameUnmarshaller() {
super(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME);
}
示例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();
}
示例14: populateRequiredData
import org.opensaml.saml2.metadata.GivenName; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
super.populateRequiredData();
GivenName givenName = (GivenName) target;
givenName.setName("name");
}
示例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());
}