contract.setContractImpl(doc);
contract.setContractImpl(doc, contractUri);
    private void contractProcessingStart(Attributes attr) throws SAXException {        try {            if (contract == null)                contract = new ContractBeanDOMImpl(this.manager,parameterHelper);            else                contract.initialize();        } catch (ParserConfigurationException e) {            String error = DispatcherException.ERROR_500 + "\n"                    + "component: ContractBean" + "\n"                    + "message: Could not setup contractBean." + "\n" + "\n\n"                    + "dispatcherErrorStack:\n" + e;            getLogger().error(error);            throw new SAXException(error);        }        for (int i = 0; i < attr.getLength(); i++) {            String localName = attr.getLocalName(i);            String value = attr.getValue(i);            if (ContractBean.CONTRACT_ID_ATTRIBUTE.equals(localName)) {                // getting the contract name                contract.setContractName(value);                String contractUri = ContractBean.CONTRACT_RESOLVE_PREFIX + "."                        + currentFormat + "." + value;                try {                    Document doc = org.apache.forrest.dispatcher.util.SourceUtil                            .readDOM(contractUri, this.manager);                    contract.setContractImpl(doc);                    // contract.setContractImpl(contractUri);                } catch (Exception e) {                    String error = "dispatcherError: "                            + DispatcherException.ERROR_500                            + "\n"                            + "The contract \""                            + contract.getContractName()                            + "\" has thrown an exception by resolving the implementation from \""                            + contractUri + "\".\n\n"                            + "dispatcherErrorStack:\n" + e;                    getLogger().error(error);                    throw new SAXException(error);                }                if (getLogger().isDebugEnabled()) {                    getLogger().debug(                            "DISPATCHER_CONTRACT_ID_ATTRIBUTE" + "-->"                                    + localName + "\n" + "value" + "-->"                                    + value);                }            } else if (ContractBean.CONTRACT_NUGGET_ATTRIBUTE.equals(localName)) {                // contract is a nugget-contract                contract.setNugget(true);                try {                    Document doc = org.apache.forrest.dispatcher.util.SourceUtil                            .readDOM(value, this.manager);                    contract.setContractRawData(doc);                    // contract.setNuggetUri(value);                } catch (Exception e) {                    String error = "dispatcherError: "                            + DispatcherException.ERROR_500                            + "\n"                            + "The contract \""                            + contract.getContractName()                            + "\" has thrown thrown an exception by resolving raw data from \""                            + value + "\".\n\n" + "dispatcherErrorStack:\n "                            + e;                    getLogger().error(error);                    throw new SAXException(error);                }                if (getLogger().isDebugEnabled()) {                    getLogger().debug(                            "ContractBean.CONTRACT_NUGGET_ATTRIBUTE" + "-->"                                    + localName + "\n" + "value" + "-->"                                    + value);                }            } else {                if (getLogger().isDebugEnabled()) {                    getLogger().debug(                            "localName" + "-->" + localName                                    + " not implemented");                }            }        }        /*         * if we do not have a nugget add a foo element to the raw data to         * invoke the transformation.         */        if (!contract.isNugget()) {            Document foo;            try {                foo = dispatcherHelper.createDocument("foo");                contract.setContractRawData(foo);            } catch (Exception e) {                String error = "dispatcherError: "                        + DispatcherException.ERROR_500                        + "\n"                        + "The contract \""                        + contract.getContractName()                        + "\" has thrown thrown an exception by creating the dummy foo document."                        + ".\n\n" + "dispatcherErrorStack:\n " + e;                getLogger().error(error);                throw new SAXException(error);            }        }    }