Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoPackage


        } else if (tag.equals("class")) { //tag class
          String fullcn = node.getFirstChild().getNodeValue();
          String pac = fullcn.substring(0, fullcn.lastIndexOf('.'));
          String cn = fullcn.substring(fullcn.lastIndexOf('.') + 1,
              fullcn.length());
          SpeedoPackage sp = (SpeedoPackage) ((SpeedoXMLDescriptor) o).packages.get(pac);
          if (sp == null) {
            sp = new SpeedoPackage();
        sp.name = pac;
        sp.xmlDescriptor = (SpeedoXMLDescriptor) o;
                ((SpeedoXMLDescriptor) o).packages.put(pac, sp);
                logger.log(BasicLevel.DEBUG, "New package: name= " + pac);
          }
View Full Code Here


    public void visitXml(SpeedoXMLDescriptor xml) throws SpeedoException {
        super.visitXml(xml);
        Iterator packIt = xml.packages.values().iterator();
        while(packIt.hasNext()) {
            SpeedoPackage pack = (SpeedoPackage) packIt.next();
            visitPackage(pack);
        }
    }
View Full Code Here

    public void process() throws SpeedoException {
        visitedClasses.clear();
        for (Iterator xmlIt = scp.smi.xmlDescriptors.values().iterator(); xmlIt.hasNext();) {
            SpeedoXMLDescriptor xml = (SpeedoXMLDescriptor) xmlIt.next();
            for (Iterator packIt = xml.packages.values().iterator(); packIt.hasNext();) {
                SpeedoPackage sp = (SpeedoPackage) packIt.next();
                for (Iterator classIt = sp.classes.values().iterator(); classIt.hasNext();) {
                    SpeedoClass sc = (SpeedoClass) classIt.next();
                    visitSpeedoClass(sc, VisitRequired.ALL);
                }
            }
View Full Code Here

    private void addSerializeJormMI(SpeedoXMLDescriptor desc)
            throws SpeedoException {
        // Calculate the list of the Jorm Meta Object which must be serialized
        //Set mos = new HashSet(desc.jdoPackage.size());
        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 "
View Full Code Here

public class JDODefaults extends SpeedoDefaults {

  public void assignDefaults(Object se) throws SpeedoRuntimeException {
    ((SpeedoElement) se).personality = Personality.JDO;
        if (se instanceof SpeedoPackage) {
      SpeedoPackage sp = (SpeedoPackage) se;
      //sp.classes = ?;
      //sp.jdoExtension = ?;
      //sp.name = ?;
      //sp.sequences = ?;
      //sp.xmlDescriptor = ?;
View Full Code Here

public class EJBDefaults extends SpeedoDefaults {
  final static String UNKNOWN = "unknown";
  public void assignDefaults(Object se) throws SpeedoRuntimeException {
    ((SpeedoElement) se).personality = Personality.EJB;
    if (se instanceof SpeedoPackage) {
      SpeedoPackage sp = (SpeedoPackage) se;
      //sp.classes = ?;
      //sp.jdoExtension = ?;
      sp.name = UNKNOWN;
      //sp.sequences = ?;
      sp.xmlDescriptor = null;
View Full Code Here

    super.process();
    //compute fields number for each class
    for (Iterator itDesc = scp.getXmldescriptor().values().iterator(); itDesc.hasNext();) {   
          SpeedoXMLDescriptor desc = (SpeedoXMLDescriptor) itDesc.next();   
          for (Iterator itPack = desc.packages.values().iterator(); itPack.hasNext();) {   
              SpeedoPackage sp = (SpeedoPackage) itPack.next();   
              for (Iterator itclass = sp.classes.values().iterator(); itclass.hasNext();) {   
                  SpeedoClass clazz = (SpeedoClass) itclass.next();   
                  clazz.computeFieldNumbers();   
              }   
          }   
View Full Code Here

              Node n = packageNode.getAttributes().getNamedItem("name");
              if (n == null) {
                  logger.log(BasicLevel.ERROR, "Attribute 'name' for tag package required.");
                  continue;
              }
              SpeedoPackage p = new SpeedoPackage();
              p.name = n.getNodeValue();
              xmlDesc.add(p, true, logger);
              logger.log(BasicLevel.DEBUG, "Parsing package: name= " + p.name);
              Map packageChildren = groupChildrenByName(packageNode);
              treatExtensions((List) packageChildren.remove("extension"), p);
View Full Code Here

        ((SpeedoElement) mo).addExtension(e);
        e.owner = (SpeedoElement) mo;
        return e;
    }
    private Object treatPackage(Node node, Object mo) throws SpeedoException {
        SpeedoPackage p = new SpeedoPackage();
        //attribute name (compulsory)
        Node n = node.getAttributes().getNamedItem("name");
        if (n == null)
            throw new SpeedoXMLError("Attribute name for tag package requested.");
        p.name = n.getNodeValue();
View Full Code Here

      Iterator i = xml.iterator();
        while (i.hasNext()) {
            SpeedoXMLDescriptor xmlDesc = (SpeedoXMLDescriptor) i.next();
            String fieldPackage = NamingRules.packageName(className);
            String fieldClass = NamingRules.className(className);
            SpeedoPackage pkg = (SpeedoPackage) xmlDesc.packages.get(fieldPackage);
            if (pkg != null) {
                SpeedoClass c = (SpeedoClass) pkg.classes.get(fieldClass);
                if (c != null) {
                    return c;
                }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.metadata.SpeedoPackage

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.