public String equivalence(final Namespace sourceNamespace,
            final String sourceValue, final Namespace targetNamespace)
            throws EquivalencerException {

        if (sourceNamespace == null) {
            throw new InvalidArgument("sourceNamespace", sourceNamespace);
        }

        if (noLength(sourceValue)) {
            throw new InvalidArgument("sourceValue", sourceValue);
        }

        if (targetNamespace == null) {
            throw new InvalidArgument("targetNamespace", targetNamespace);
        }

        loadEquivalencingEngine();

        // convert namespace and value to parameter (common model).
        final Parameter sp = new Parameter(sourceNamespace, sourceValue);

        try {
            Parameter parameter = this.paramEquivalencer.findEquivalence(sp,
                    targetNamespace);
            return parameter == null ? null : parameter.getValue();
        } catch (InvalidArgument e) {
            //TODO change exception when paramEquivalencer is changed
            return null;
        } catch (Exception e) {
            final String fmt = "Unable to find equivalences for '%s'";
            final String msg = format(fmt, sp.toBELShortForm());
            throw new EquivalencerException(msg, e);
        }
    }
public String equivalence ( final Namespace sourceNamespace , final String sourceValue , final Namespace targetNamespace ) throws EquivalencerException { if ( sourceNamespace == null ) { throw new InvalidArgument ( "sourceNamespace" , sourceNamespace ) ; } if ( noLength ( sourceValue ) ) { throw new InvalidArgument ( "sourceValue" , sourceValue ) ; } if ( targetNamespace == null ) { throw new InvalidArgument ( "targetNamespace" , targetNamespace ) ; } loadEquivalencingEngine ( ) ; final Parameter sp = new Parameter ( sourceNamespace , sourceValue ) ; try { Parameter parameter = this . paramEquivalencer . findEquivalence ( sp , targetNamespace ) ; return parameter == null ? null : parameter . getValue ( ) ; } catch ( InvalidArgument e ) { return null ; } catch ( Exception e ) { final String fmt = "Unable to find equivalences for '%s'" ; final String msg = format ( fmt , sp . toBELShortForm ( ) ) ; throw new EquivalencerException ( msg , e ) ; } }
Finds a parameter, equivalent to the <tt>sourceParameter</tt>, and found
in the {@link Namespace} identified by <tt>targetNamespace</tt>.
<p>
Note: The first time any method in {@link Equivalencer} is called the
equivalencing engine is instantiated, but only once. The equivalencing
engine loads the BEL equivalence files associated with the framework and
uses them do perform equivalencing.
</p>

@param sourceNamespace {@link Namespace}, the namespace of the source
parameter
@param sourceValue {@link String}, the source parameter value
@param targetNamespace {@link Namespace}, the namespace of the equivalent
parameter to find
@return the equivalent parameter found in <tt>targetNamespace</tt>, or
null if no equivalent parameter is found in that namespace
@throw InvalidArgument Thrown if <tt>sourceNamespace</tt>,
<tt>sourceParameter</tt>, or <tt>targetNamespace</tt> is null
@throws EquivalencerException Thrown if an exception occurs finding the
equivalent parameter