Example usage for javax.xml.registry UnexpectedObjectException UnexpectedObjectException

List of usage examples for javax.xml.registry UnexpectedObjectException UnexpectedObjectException

Introduction

In this page you can find the example usage for javax.xml.registry UnexpectedObjectException UnexpectedObjectException.

Prototype

public UnexpectedObjectException(Throwable cause) 

Source Link

Document

Constructs a JAXRException object initialized with the given Throwable object.

Usage

From source file:it.cnr.icar.eric.client.xml.registry.BusinessQueryManagerImpl.java

@SuppressWarnings("unused")
static private String classificationToConceptId(Object obj) throws JAXRException {
    if (!(obj instanceof Classification)) {
        throw new UnexpectedObjectException(JAXRResourceBundle.getInstance()
                .getString("message.error.expected.collection.objectType.Classification"));
    }//ww w .ja v  a  2 s .c om

    Classification cl = (Classification) obj;

    if (cl.isExternal()) {
        throw new JAXRException(JAXRResourceBundle.getInstance()
                .getString("message.error.no.support.external.classification.qaulifier"));
    }

    Concept concept = cl.getConcept();

    if (concept == null) {
        throw new JAXRException(JAXRResourceBundle.getInstance()
                .getString("message.error.internal.classification.concept.null"));
    }

    return concept.getKey().getId();
}