Package oracle.toplink.essentials.internal.ejb.cmp3.xml.parser

Examples of oracle.toplink.essentials.internal.ejb.cmp3.xml.parser.XMLExceptionHandler


        NodeList nodes = m_helper.getNodes(m_node, XMLConstants.ASSOCIATION_OVERRIDE);
       
        if (nodes != null) {
            for (int i = 0; i < nodes.getLength(); i++) {
                Node node = nodes.item(i);
                processAssociationOverride(m_helper.getNodeValue(node, XMLConstants.ATT_NAME), new XMLJoinColumns(node, m_helper));
            }
        }
       
        // Process the association override annotations second.
        super.processAssociationOverrides();
View Full Code Here


    /**
     * INTERNAL: (Override from MetadataAccessor)
     */   
    protected MetadataPrimaryKeyJoinColumns getPrimaryKeyJoinColumns(String sourceTableName, String targetTableName) {
        if (m_helper.nodeHasPrimaryKeyJoinColumns(m_node)) {
            return new XMLPrimaryKeyJoinColumns(m_node, m_helper, sourceTableName, targetTableName);
        } else {
            return super.getPrimaryKeyJoinColumns(sourceTableName, targetTableName);
        }
    }
View Full Code Here

     * INTERNAL: (OVERRIDE)
     * Process the primary-key-join-column(s) elements.
     */   
    protected MetadataPrimaryKeyJoinColumns getPrimaryKeyJoinColumns(String sourceTableName, String targetTableName) {
        if (m_helper.nodeHasPrimaryKeyJoinColumns(m_node)) {
            return new XMLPrimaryKeyJoinColumns(m_node, m_helper, sourceTableName, targetTableName);
        } else {
            return super.getPrimaryKeyJoinColumns(sourceTableName, targetTableName);
        }
    }
View Full Code Here

    public MetadataEntityListener processEntityEventListener(ClassLoader loader) {
        // Update the class loader.
        m_helper.setLoader(loader);
       
        // Create the listener.
        XMLEntityClassListener listener = new XMLEntityClassListener(getJavaClass());
           
        // Process the lifecycle callback events from XML.
        Method[] candidateMethods = MetadataHelper.getCandidateCallbackMethodsForEntityClass(getJavaClass());
        processLifecycleEvents(listener, m_node, m_helper, candidateMethods);
           
View Full Code Here

           
            for (int i = 0; i < nodes.getLength(); i++) {
                Node node = nodes.item(i);
               
                // Build an xml entity listener.
                XMLEntityListener listener = new XMLEntityListener(helper.getClassForNode(node), getJavaClass());
               
                // Process the lifecycle callback events from XML.
                Method[] candidateMethods = MetadataHelper.getCandidateCallbackMethodsForDefaultListener(listener);
                processLifecycleEvents(listener, node, helper, candidateMethods);
               
View Full Code Here

        if (nodes.getLength() > 0) {
            for (int i = 0; i < nodes.getLength(); i++) {
                Node node = nodes.item(i);
               
                // Build an xml entity listener.
                XMLEntityListener listener = new XMLEntityListener(m_helper.getClassForNode(node), entityClass);
               
                // Process the lifecycle callback events from XML.
                Method[] candidateMethods = MetadataHelper.getCandidateCallbackMethodsForEntityListener(listener);
                processLifecycleEvents(listener, node, m_helper, candidateMethods);
               
View Full Code Here

        } catch (ParserConfigurationException pex) {
            throw XMLParseException.exceptionCreatingDocumentBuilder(documentName, pex);
        }
       
        // set the parse exception handler
        XMLExceptionHandler xmlExceptionHandler = new XMLExceptionHandler();
        db.setErrorHandler(xmlExceptionHandler);
       
        // parse the document
        Document doc = null;
        try {
            doc = db.parse(xmlDocumentInputStream);
        } catch (IOException ioex) {
            throw XMLParseException.exceptionReadingXMLDocument(documentName, ioex);
        } catch (SAXException saxex) {
          // XMLExceptionHandler will handle parse exceptions
        }
       
        XMLException xmlEx = xmlExceptionHandler.getXMLException();
        if (xmlEx != null) {
          throw ValidationException.invalidEntityMappingsDocument(documentName, xmlEx);
        }
       
        return doc;
View Full Code Here

        spf.setNamespaceAware(true);
        spf.setValidating(true);
       
        XMLReader xmlReader = null;
        SAXParser sp = null;
        XMLExceptionHandler xmlErrorHandler = new XMLExceptionHandler();

        // create a SAX parser
        try {
            sp = spf.newSAXParser();
          sp.setProperty(XMLConstants.SCHEMA_LANGUAGE, XMLConstants.XML_SCHEMA);
      } catch (javax.xml.parsers.ParserConfigurationException exc){
        throw XMLParseException.exceptionCreatingSAXParser(baseURL, exc);
      } catch (org.xml.sax.SAXException exc){
        throw XMLParseException.exceptionCreatingSAXParser(baseURL, exc);
      }
         
      // create an XMLReader
      try {
            xmlReader = sp.getXMLReader();
          xmlReader.setErrorHandler(xmlErrorHandler);
        } catch (org.xml.sax.SAXException exc){
          throw XMLParseException.exceptionCreatingXMLReader(baseURL, exc);
        }
      
        // attempt to load the schema from the classpath
        URL schemaURL = loader.getResource(XMLConstants.PERSISTENCE_SCHEMA_NAME);
        if (schemaURL != null) {
            try {
              sp.setProperty(XMLConstants.JAXP_SCHEMA_SOURCE, schemaURL.toString());
            } catch (org.xml.sax.SAXException exc){
              throw XMLParseException.exceptionSettingSchemaSource(baseURL, schemaURL, exc);
            }
        }

        PersistenceContentHandler myContentHandler = new PersistenceContentHandler();
        xmlReader.setContentHandler(myContentHandler);

        InputSource inputSource = new InputSource(input);
        try{
            xmlReader.parse(inputSource);
        } catch (IOException exc){
            throw PersistenceUnitLoadingException.exceptionProcessingPersistenceXML(baseURL, exc);
        } catch (org.xml.sax.SAXException exc){
          // XMLErrorHandler will handle SAX exceptions
        }
       
        // handle any parse exceptions
        XMLException xmlError = xmlErrorHandler.getXMLException();
        if (xmlError != null) {
            throw PersistenceUnitLoadingException.exceptionProcessingPersistenceXML(baseURL, xmlError);
        }

        Iterator<SEPersistenceUnitInfo> persistenceInfos = myContentHandler.getPersistenceUnits().iterator();
View Full Code Here

     */
    protected void processNamedNativeQueries(NodeList queryNodes) {
        if (queryNodes != null) {
            for (int i = 0; i < queryNodes.getLength(); i++) {
                // Ask the common processor to process what we found.
                processNamedNativeQuery(new XMLNamedNativeQuery(queryNodes.item(i), m_helper));
            }
        }
    }
View Full Code Here

     */
    protected void processNamedQueries(NodeList queryNodes) {
        if (queryNodes != null) {
            for (int i = 0; i < queryNodes.getLength(); i++) {
                // Ask the common processor to process what we found.
                processNamedQuery(new XMLNamedQuery(queryNodes.item(i), m_helper));
            }
        }
    }
View Full Code Here

TOP

Related Classes of oracle.toplink.essentials.internal.ejb.cmp3.xml.parser.XMLExceptionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.