Search in sources :

Example 1 with RelatedPartyType

use of eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType in project arctic-sea by 52North.

the class RelatedPartyTypeDecoder method parseContact.

private Contact parseContact(RelatedPartyType rpt) throws DecodingException {
    ContactType ct = rpt.getContact().getContact();
    Contact contact = new Contact();
    contact.setAddress(parseAddress(ct));
    contact.setContactInstructions(parseContactInstructions(ct));
    contact.setElectronicMailAddress(parseElectronicMailAddress(ct));
    contact.setTelephoneFacsimile(parseTelephoneFacsimile(ct));
    contact.setTelephoneVoice(parseTelephoneVoice(ct));
    contact.setWebsite(parseWebsite(ct));
    return contact;
}
Also used : ContactType(eu.europa.ec.inspire.schemas.base2.x20.ContactType) Contact(org.n52.shetland.inspire.base2.Contact)

Example 2 with RelatedPartyType

use of eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType in project arctic-sea by 52North.

the class RelatedPartyTypeDecoder method decode.

@Override
public RelatedParty decode(XmlObject xmlObject) throws DecodingException {
    if (xmlObject instanceof RelatedPartyType) {
        RelatedPartyType rpt = (RelatedPartyType) xmlObject;
        RelatedParty relatedParty = new RelatedParty();
        relatedParty.setContact(parseContact(rpt));
        relatedParty.setIndividualName((PT_FreeText) decodeXmlElement(rpt.getIndividualName()));
        relatedParty.setOrganisationName((PT_FreeText) decodeXmlElement(rpt.getOrganisationName()));
        relatedParty.setPositionName((PT_FreeText) decodeXmlElement(rpt.getPositionName()));
        relatedParty.setRoles(parseRole(rpt));
        return relatedParty;
    }
    throw new UnsupportedDecoderInputException(this, xmlObject);
}
Also used : RelatedParty(org.n52.shetland.inspire.base2.RelatedParty) RelatedPartyType(eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)

Example 3 with RelatedPartyType

use of eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType in project arctic-sea by 52North.

the class RelatedPartyTypeEncoder method createRelatedParty.

private XmlObject createRelatedParty(RelatedParty relatedParty) throws EncodingException {
    RelatedPartyType rpt = RelatedPartyType.Factory.newInstance();
    addContact(rpt, relatedParty);
    addIndividualName(rpt, relatedParty);
    addOrganisationName(rpt, relatedParty);
    addPositionName(rpt, relatedParty);
    addRole(rpt, relatedParty);
    return rpt;
}
Also used : RelatedPartyType(eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType)

Aggregations

RelatedPartyType (eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType)2 ContactType (eu.europa.ec.inspire.schemas.base2.x20.ContactType)1 Contact (org.n52.shetland.inspire.base2.Contact)1 RelatedParty (org.n52.shetland.inspire.base2.RelatedParty)1 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)1