public Object getObject(SchemaEntry schemaEntry) {

    String elementName = schemaEntry.getElementName();
    String elementParentName = schemaEntry.getElementParentName();

    Object parentInstanceElement = null;
    if (schemaEntry.getParent() != null)
      parentInstanceElement = schemaEntry.getParent().getInstanceElement();

    if (elementName.compareTo(Tag.listaDP) == 0) return (this.plugData).getListaDP();
    // if ((elementName.compareTo(Tag.listaThread)==0)&&
    // (elementParentName.compareTo(Tag.listaDP)==0))
    //  return (this.plugData).getListaDP();

    if ((elementName.compareTo(Tag.listaStato) == 0)
        && (elementParentName.compareTo(Tag.threadElement) == 0))
      return ((ThreadElement) parentInstanceElement).getListaStato();

    if ((elementName.compareTo(Tag.listaMessaggio) == 0)
        && (elementParentName.compareTo(Tag.threadElement) == 0))
      return ((ThreadElement) parentInstanceElement).getListaMessaggio();

    //	if ((elementName.compareTo(Tag.threadElement)==0)&&
    // (elementParentName.compareTo(Tag.listaThread)==0))
    //	 return ((ListaThread)parentInstance).getThreadElement();

    return null;
  }
  public Object getElement(SchemaEntry schemaEntry) {

    String elementName = schemaEntry.getElementName();
    String elementParentName = schemaEntry.getElementParentName();

    if (elementName.compareTo(Tag.elementoParam) == 0) {

      return (String) schemaEntry.getInstanceElement();
    }

    if (elementName.compareTo(Tag.guard) == 0) {

      String guard = ((ElementoMessaggio) schemaEntry.getParent().getInstanceElement()).getGuard();
      if (guard.equals("")) return null;
      return guard;
    }

    if (elementName.compareTo(Tag.operations) == 0) {
      String operation =
          ((ElementoMessaggio) schemaEntry.getParent().getInstanceElement()).getOperations();

      if (operation.equals("")) return null;
      return operation;
    }

    if (elementName.compareTo(Tag.onEntryCode) == 0) {

      return ((ElementoStato) schemaEntry.getParent().getInstanceElement()).getOnEntryCode();
    }

    if (elementName.compareTo(Tag.onExitCode) == 0) {

      return ((ElementoStato) schemaEntry.getParent().getInstanceElement()).getOnExitCode();
    }

    return null;
  }
  public Object[] getList(SchemaEntry schemaEntry) {

    String elementName = schemaEntry.getElementName();
    String elementParentName = schemaEntry.getElementParentName();

    Object parentInstanceElement = null;
    if (schemaEntry.getParent() != null)
      parentInstanceElement = schemaEntry.getParent().getInstanceElement();

    if ((elementName.compareTo(Tag.listaThread) == 0)
        && (elementParentName.compareTo(Tag.listaDP) == 0)) {

      ArrayList result = new ArrayList();
      ListaDP listaDp = ((ListaDP) parentInstanceElement);

      for (int i = 0; i < listaDp.size(); i++) {
        result.add(listaDp.get(i));
      }
      return (Object[]) result.toArray(new Object[result.size()]);
    }

    if ((elementName.compareTo(Tag.threadElement) == 0)
        && (elementParentName.compareTo(Tag.listaThread) == 0)) {

      ArrayList result = new ArrayList();
      ListaThread listaThread = ((ListaThread) parentInstanceElement);

      Iterator ite = listaThread.iterator();
      while (ite.hasNext()) {
        ThreadElement te = (ThreadElement) ite.next();
        result.add(te);
      }
      return (Object[]) result.toArray(new Object[result.size()]);
    }

    if ((elementName.compareTo(Tag.elementoStato) == 0)
        && (elementParentName.compareTo(Tag.listaStato) == 0)) {

      ArrayList result = new ArrayList();

      ListaStato listaStato = ((ListaStato) parentInstanceElement);
      Iterator ite = listaStato.iterator();
      while (ite.hasNext()) {
        ElementoStato es = (ElementoStato) ite.next();
        result.add(es);
      }
      return (Object[]) result.toArray(new Object[result.size()]);
    }

    if ((elementName.compareTo(Tag.elementoMessaggio) == 0)
        && (elementParentName.compareTo(Tag.listaMessaggio) == 0)) {

      ArrayList result = new ArrayList();

      ListaMessaggio listaMessaggio = ((ListaMessaggio) parentInstanceElement);
      Iterator ite = listaMessaggio.iterator();
      while (ite.hasNext()) {
        ElementoMessaggio em = (ElementoMessaggio) ite.next();
        result.add(em);
      }
      return (Object[]) result.toArray(new Object[result.size()]);
    }

    if ((elementName.compareTo(Tag.elementoParam) == 0)
        && (elementParentName.compareTo(Tag.parametri) == 0)) {

      LinkedList listaParametri =
          ((ElementoMessaggio) (schemaEntry.getParent().getParent().getInstanceElement()))
              .getParameters();

      ArrayList result = new ArrayList();
      Iterator ite = listaParametri.iterator();
      while (ite.hasNext()) {
        result.add(ite.next());
      }

      return (Object[]) result.toArray(new Object[result.size()]);
    }

    return null;
  }