コード例 #1
0
  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;
  }
コード例 #2
0
  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;
  }
コード例 #3
0
  public SimpleValue getAttributeValue(SchemaEntry schemaEntry, String attributeName) {

    String elementName = schemaEntry.getElementName();
    Object instanceElement = schemaEntry.getInstanceElement();
    Object parentInstanceElement = null;
    if (schemaEntry.getParent() != null)
      parentInstanceElement = schemaEntry.getParent().getInstanceElement();

    if ((elementName.compareTo(Tag.listaThread) == 0)
        && (attributeName.compareTo(Tag.att_LT_processo) == 0))
      return new SimpleValue(
          (Tag.att_EPR_pre_id + ((ListaThread) instanceElement).getIdProcesso()));

    if ((elementName.compareTo(Tag.threadElement) == 0)
        && (attributeName.compareTo(Tag.att_TE_nome) == 0))
      return new SimpleValue((((ThreadElement) instanceElement).getNomeThread()));

    if ((elementName.compareTo(Tag.threadElement) == 0)
        && (attributeName.compareTo(Tag.att_TE_numStato) == 0))
      return new SimpleValue(
          (new Long(((ThreadElement) instanceElement).getNumStato()).toString()));

    if ((elementName.compareTo(Tag.elementoStato) == 0)
        && (attributeName.compareTo(Tag.att_EST_id) == 0))
      return new SimpleValue((Tag.att_EST_pre_id + ((ElementoStato) instanceElement).getId()));

    if ((elementName.compareTo(Tag.elementoStato) == 0)
        && (attributeName.compareTo(Tag.att_EST_tipo) == 0))
      return new SimpleValue((((ElementoStato) instanceElement).getTipo()));

    if ((elementName.compareTo(Tag.elementoStato) == 0)
        && (attributeName.compareTo(Tag.att_EST_nome) == 0))
      return new SimpleValue((((ElementoStato) instanceElement).getName()));

    if ((elementName.compareTo(Tag.elementoMessaggio) == 0)
        && (attributeName.compareTo(Tag.att_EME_tipo) == 0))
      return new SimpleValue((((ElementoMessaggio) instanceElement).getTipo()));

    if ((elementName.compareTo(Tag.elementoMessaggio) == 0)
        && (attributeName.compareTo(Tag.att_EME_nome) == 0))
      return new SimpleValue((((ElementoMessaggio) instanceElement).getName()));

    if ((elementName.compareTo(Tag.elementoMessaggio) == 0)
        && (attributeName.compareTo(Tag.att_EME_flussodiretto) == 0))
      return new SimpleValue((((ElementoMessaggio) instanceElement).getFlussoDiretto()));

    if ((elementName.compareTo(Tag.elementoMessaggio) == 0)
        && (attributeName.compareTo(Tag.att_EME_sendReceive) == 0))
      return new SimpleValue((((ElementoMessaggio) instanceElement).getSendReceive()));

    if ((elementName.compareTo(Tag.elementoMessaggio) == 0)
        && (attributeName.compareTo(Tag.att_EME_rff) == 0))
      return new SimpleValue((((ElementoMessaggio) instanceElement).getMsgRRF()));

    if ((elementName.compareTo(Tag.elementoMessaggio) == 0)
        && (attributeName.compareTo(Tag.att_EME_id) == 0))
      return new SimpleValue((Tag.att_EME_pre_id + ((ElementoMessaggio) instanceElement).getId()));

    if ((elementName.compareTo(Tag.elementoStatoFrom) == 0)
        && (attributeName.compareTo(Tag.att_ESFrom_idref) == 0))
      return new SimpleValue(
          (Tag.att_EST_pre_id
              + ((ElementoMessaggio) parentInstanceElement).getElementFrom().getId()));

    if ((elementName.compareTo(Tag.elementoStatoTo) == 0)
        && (attributeName.compareTo(Tag.att_ESTo_idref) == 0))
      return new SimpleValue(
          (Tag.att_EST_pre_id
              + ((ElementoMessaggio) parentInstanceElement).getElementTo().getId()));

    return null;
  }
コード例 #4
0
  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;
  }