Package org.objectweb.speedo.api

Examples of org.objectweb.speedo.api.SpeedoException


        for (Iterator itPack = desc.packages.values().iterator(); itPack.hasNext();) {
            SpeedoPackage sp = (SpeedoPackage) itPack.next();
            for (Iterator itclass = sp.classes.values().iterator(); itclass.hasNext();) {
                SpeedoClass jdoClass = (SpeedoClass) itclass.next();
                if (jdoClass.jormclass == null)
                    throw new SpeedoException(
                            "The Jorm meta information of the jdo descriptor "
                            + desc.xmlFile + " is not complete: class "
                            + jdoClass.name + " has not been found");
                // The class meta object
                addMOClass(jdoClass.jormclass, desc.mos);
View Full Code Here


                }
            }
        } catch (PException e) {
            logger.log(BasicLevel.ERROR, "Impossible to configure Jorm",
                    ExceptionHelper.getNested(e));
            throw new SpeedoException("Impossible to configure Jorm", e);
        }
        scp.generatorsContext.put("jormcompiler", jormcompiler);
        return true;
    }
View Full Code Here

    }
    public void process() throws SpeedoException {
        try {
            process2();
        } catch(PException e) {
            throw new SpeedoException("Error during Jorm generation", e);
        }
    }
View Full Code Here

            logger.log(BasicLevel.DEBUG,
                    "Verify the definition of the class " + clas.getFQName());
        }
        Class classJorm = manager.getClass(clas.getFQName());
        if (classJorm == null) {
            throw new SpeedoException("Jorm description of the class '"
                    + clas.getFQName() + "' is not availlable");
        }
        NameDef pName = null;
        SpeedoClass sc = clas;
        while(sc.getSuperClassName() != null) {
            SpeedoClass scl = sc;
            sc = sc.moPackage.xmlDescriptor.smi.getSpeedoClass(sc.getSuperClassName(), sc.moPackage);
            if (sc == null) {
                throw new SpeedoException("Class " + scl.getFQName()
                        + " not defined in the jorm meta information");
            }
        }
        Class pclassJorm = manager.getClass(sc.getFQName());
        pName = getClassNameDef(pclassJorm);
View Full Code Here


    private Mapping getMapping(Class clazz) throws SpeedoException {
        ClassProject cp = clazz.getClassProject(scp.projectName);
        if (cp == null) {
            throw new SpeedoException("No classproject found for the class "
                    + clazz.getFQName() + " and  the project " + scp.projectName);
        }
        int idx =  scp.mapperName.indexOf('.');
        Mapping m = cp.getMapping(idx == -1
                ? scp.mapperName
                : scp.mapperName.substring(0, idx));
        if (m == null) {
            throw new SpeedoException("No mapping found for the class "
                    + clazz.getFQName() + ",  the project " + scp.projectName
                    + " and  the mapper " + scp.mapperName);
        }
        return m;
    }
View Full Code Here

                           String projectName,
                           String mapperName) throws SpeedoException {
    debug = logger != null && logger.isLoggable(BasicLevel.DEBUG);
    Expression medorExpression = parser.parse(filter);
    if (!isJormPredicate(medorExpression)) {
      throw new SpeedoException(
          "The specified filter is not supported, \n\tclass"
          + sc.getFQName() + "\n\tfilter=" + filter);
    }
    rdbFilter.setExpression(medorExpression);
  }
View Full Code Here

    public synchronized Expression parse(String filter) throws SpeedoException {
      try {
        visit(new SpeedoQL(new CharArrayReader(filter.toCharArray())).SpeedoQL());
        return expression;
      } catch (ParseException e) {
        throw new SpeedoException(
            "Impossible to parse the filter and to create AST", e);
      } catch (SpeedoException e) {
        throw e;
      } catch (Exception e) {
        throw new SpeedoException("Impossible to parse the filter", e);
      }
    }
View Full Code Here

        String buildercn;
        if (mapperName != null) {
            if (mapperName.startsWith("rdb")) {
                buildercn = DEFAULT_RDB_BUILDER;
            } else {
                throw new SpeedoException(
                        "No default JormMIMappingBuilder for the mapper "
                        + mapperName);
            }
            try {
                jmimb = (JormMIMappingBuilder)
                        java.lang.Class.forName(buildercn).newInstance();
            } catch (Exception e) {
                throw new SpeedoException("Impossible to instanciate a the class "
                        + buildercn);
            }
            if (jmimb instanceof Loggable) {
                ((Loggable) jmimb).setLogger(logger);
            }
View Full Code Here

                               String projectName,
                               String mapperName,
                               JormMIMappingBuilder mb)
            throws SpeedoException, PException {
      if (manager == null) {
            throw new SpeedoException(
                    "the Jorm meta information manager must be assigned");
        }
      int size = scs.size();
      debug = logger.isLoggable(BasicLevel.DEBUG);
        ArrayList createdMOs = new ArrayList(size * 2);
 
View Full Code Here

            createdMOs.add(clazz);
        }
    if (sc.getSuperClassName() != null) {
      SpeedoClass parent = sc.getSpeedoClassFromContext(sc.getSuperClassName());
      if (parent == null) {
        throw new SpeedoException("No super class '"
            + sc.getSuperClassName() + "'found in the .jdo file: "
            + sc.getXMLFileName());
      }
      Class parentClazz = manager.getClass(parent.getFQName());
      if (parentClazz == null) {
        throw new SpeedoException("Internal algorythm problem: parent class must be treated before sub classes");
      }
      clazz.addSuperClass(parentClazz);
    }
        sc.jormclass = clazz;
      sc.jormclass.setAbstract(sc.isAbstract);
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.api.SpeedoException

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.