congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
T2Reference.getReferenceType
Code IndexAdd Tabnine to your IDE (free)

How to use
getReferenceType
method
in
net.sf.taverna.t2.reference.T2Reference

Best Java code snippets using net.sf.taverna.t2.reference.T2Reference.getReferenceType (Showing top 20 results out of 315)

origin: net.sf.taverna.t2.component/component-activity

private Set<T2Reference> getErrors(T2Reference ref) {
  Set<T2Reference> result = new HashSet<T2Reference>();
  if (ref.getReferenceType().equals(ReferenceSet)) {
    // nothing
  } else if (ref.getReferenceType().equals(IdentifiedList)) {
    IdentifiedList<T2Reference> originalList = listService.getList(ref);
    for (T2Reference subValue : originalList)
      if (subValue.containsErrors())
        result.addAll(getErrors(subValue));
  } else {
    result.add(ref);
  }
  return result;
}
origin: net.sf.taverna.t2.component/component-activity

private T2Reference findFirstFailure(T2Reference value) {
  IdentifiedList<T2Reference> originalList = listService.getList(value);
  for (T2Reference subValue : originalList) {
    if (subValue.getReferenceType().equals(ErrorDocument))
      return subValue;
    if (subValue.getReferenceType().equals(IdentifiedList))
      if (subValue.containsErrors())
        return findFirstFailure(subValue);
    // No need to consider value
  }
  return null;
}
origin: net.sf.taverna.t2.workbench.views/results

public static List<ErrorDocument> getErrorDocuments(T2Reference reference, InvocationContext context) {
  List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>();
  if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    ErrorDocumentService errorDocumentService = context.getReferenceService().getErrorDocumentService();
    errorDocuments.add(errorDocumentService.getError(reference));            
  } else if (reference.getReferenceType().equals(T2ReferenceType.IdentifiedList)) {
    ListService listService = context.getReferenceService().getListService();
    IdentifiedList<T2Reference> list = listService.getList(reference);
    for (T2Reference listReference : list) {
      errorDocuments.addAll(getErrorDocuments(listReference, context));
    }
  }
  return errorDocuments;
}

origin: net.sf.taverna.t2.lang/results

public static List<ErrorDocument> getErrorDocuments(T2Reference reference,
    ReferenceService referenceService) {
  List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>();
  if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    ErrorDocumentService errorDocumentService = referenceService
        .getErrorDocumentService();
    errorDocuments.add(errorDocumentService.getError(reference));
  } else if (reference.getReferenceType().equals(
      T2ReferenceType.IdentifiedList)) {
    ListService listService = referenceService.getListService();
    IdentifiedList<T2Reference> list = listService.getList(reference);
    for (T2Reference listReference : list) {
      errorDocuments
          .addAll(getErrorDocuments(listReference, referenceService));
    }
  }
  return errorDocuments;
}
origin: net.sf.taverna.t2/results

public static List<ErrorDocument> getErrorDocuments(T2Reference reference,
    ReferenceService referenceService) {
  List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>();
  if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
    ErrorDocumentService errorDocumentService = referenceService
        .getErrorDocumentService();
    errorDocuments.add(errorDocumentService.getError(reference));
  } else if (reference.getReferenceType().equals(
      T2ReferenceType.IdentifiedList)) {
    ListService listService = referenceService.getListService();
    IdentifiedList<T2Reference> list = listService.getList(reference);
    for (T2Reference listReference : list) {
      errorDocuments
          .addAll(getErrorDocuments(listReference, referenceService));
    }
  }
  return errorDocuments;
}
origin: net.sf.taverna.t2.core/reference-impl

public boolean delete(T2Reference reference)
    throws ReferenceServiceException {
  boolean result=false;
  switch (reference.getReferenceType()) {
  case IdentifiedList:
    result=listService.delete(reference);
    break;
  case ReferenceSet:
    result=referenceSetService.delete(reference);
    break;
  case ErrorDocument:
    result=errorDocumentService.delete(reference);
    break;
  default:
    throw new ReferenceServiceException(
        "Unknown reference type!");
  }
  return result;
}
origin: net.sf.taverna.t2.ui-components/results-view

private void createTree(T2Reference t2Ref, ProcessorResultTreeNode parentNode){
  
  // If reference contains a list of data references
  if (t2Ref.getReferenceType() == T2ReferenceType.IdentifiedList) {
    IdentifiedList<T2Reference> list = referenceService
        .getListService().getList(t2Ref);
    if (list == null) {
      logger.error("Could not resolve list " + t2Ref + ", was run with in-memory storage?");
    }
    ProcessorResultTreeNode listNode = new ProcessorResultTreeNode(list.size(), t2Ref, referenceService); // list node
    parentNode.add(listNode);
    for (T2Reference ref : list) {
      createTree(ref, listNode);
    }
  } else { // reference to single data or an error
    insertDataNode(t2Ref, parentNode);
  }    
}
origin: net.sf.taverna.t2.core/reference-impl

public boolean delete(
    IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      sessionFactory.getCurrentSession().delete(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
  return true;
}

origin: net.sf.taverna.t2.component/component-activity

private T2Reference considerReference(T2Reference value,
    List<T2Reference> exceptions) {
  if (!value.containsErrors()) {
    return value;
  } else if (!value.getReferenceType().equals(IdentifiedList)) {
    return replaceErrors(value, exceptions);
  } else if (exceptionHandling.failLists()) {
    T2Reference failure = findFirstFailure(value);
    T2Reference replacement = replaceErrors(failure, value.getDepth(),
        exceptions);
    return replacement;
  } else {
    IdentifiedList<T2Reference> originalList = listService
        .getList(value);
    List<T2Reference> replacementList = new ArrayList<T2Reference>();
    for (T2Reference subValue : originalList)
      replacementList.add(considerReference(subValue, exceptions));
    return referenceService.register(replacementList, value.getDepth(),
        true, context);
  }
}
origin: net.sf.taverna.t2.core/reference-impl

@PutIdentifiedOperation
public void store(IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      sessionFactory.getCurrentSession().save(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
}
origin: net.sf.taverna.t2/t2reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        sessionFactory.getCurrentSession().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
origin: net.sf.taverna.t2/reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        sessionFactory.getCurrentSession().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
origin: net.sf.taverna.t2/t2reference-impl

  @PutIdentifiedOperation
  public void store(ErrorDocument theDocument) throws DaoException {
    if (theDocument.getId() == null) {
      throw new DaoException(
          "Supplied error document set has a null ID, allocate "
              + "an ID before calling the store method in the dao.");
    } else if (theDocument.getId().getReferenceType().equals(
        T2ReferenceType.ErrorDocument) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.ErrorDocument, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theDocument instanceof ErrorDocumentImpl) {
      try {
        sessionFactory.getCurrentSession().save(theDocument);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied ErrorDocument not an instance of ErrorDocumentImpl");
    }
  }
}
origin: net.sf.taverna.t2.core/reference-impl

/**
 * Construct a deep copy of the given T2Reference
 * 
 * @param source
 *            T2Reference to copy
 */
private T2ReferenceImpl(T2Reference source) {
  super();
  setNamespacePart(source.getNamespacePart());
  setLocalPart(source.getLocalPart());
  setContainsErrors(source.containsErrors());
  setReferenceType(source.getReferenceType());
  setDepth(source.getDepth());
}
origin: net.sf.taverna.t2/t2reference-impl

/**
 * Construct a deep copy of the given T2Reference
 * 
 * @param source
 *            T2Reference to copy
 */
private T2ReferenceImpl(T2Reference source) {
  super();
  setNamespacePart(source.getNamespacePart());
  setLocalPart(source.getLocalPart());
  setContainsErrors(source.containsErrors());
  setReferenceType(source.getReferenceType());
  setDepth(source.getDepth());
}
origin: net.sf.taverna.t2/reference-impl

/**
 * Construct a deep copy of the given T2Reference
 * 
 * @param source
 *            T2Reference to copy
 */
private T2ReferenceImpl(T2Reference source) {
  super();
  setNamespacePart(source.getNamespacePart());
  setLocalPart(source.getLocalPart());
  setContainsErrors(source.containsErrors());
  setReferenceType(source.getReferenceType());
  setDepth(source.getDepth());
}
origin: net.sf.taverna.t2.core/reference-impl

public boolean delete(
    IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      getHibernateTemplate().delete(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
  return true;
}

origin: net.sf.taverna.t2.core/reference-impl

@PutIdentifiedOperation
public void store(IdentifiedList<T2Reference> theList) throws DaoException {
  if (theList.getId() == null) {
    throw new DaoException("Supplied list set has a null ID, allocate "
        + "an ID before calling the store method in the dao.");
  } else if (theList.getId().getReferenceType().equals(
      T2ReferenceType.IdentifiedList) == false) {
    throw new DaoException("Strangely the list ID doesn't have type "
        + "T2ReferenceType.IdentifiedList, something has probably "
        + "gone badly wrong somewhere earlier!");
  }
  if (theList instanceof T2ReferenceListImpl) {
    try {
      getHibernateTemplate().save(theList);
    } catch (Exception ex) {
      throw new DaoException(ex);
    }
  } else {
    throw new DaoException(
        "Supplied identifier list not an instance of T2ReferenceList");
  }
}
origin: net.sf.taverna.t2/t2reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        getHibernateTemplate().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
origin: net.sf.taverna.t2/reference-impl

  @PutIdentifiedOperation
  public void store(IdentifiedList<T2Reference> theList) throws DaoException {
    if (theList.getId() == null) {
      throw new DaoException("Supplied list set has a null ID, allocate "
          + "an ID before calling the store method in the dao.");
    } else if (theList.getId().getReferenceType().equals(
        T2ReferenceType.IdentifiedList) == false) {
      throw new DaoException("Strangely the list ID doesn't have type "
          + "T2ReferenceType.IdentifiedList, something has probably "
          + "gone badly wrong somewhere earlier!");
    }
    if (theList instanceof T2ReferenceListImpl) {
      try {
        getHibernateTemplate().save(theList);
      } catch (Exception ex) {
        throw new DaoException(ex);
      }
    } else {
      throw new DaoException(
          "Supplied identifier list not an instance of T2ReferenceList");
    }
  }
}
net.sf.taverna.t2.referenceT2ReferencegetReferenceType

Javadoc

To determine the entity that this reference points to we use an enumeration of possible entity types

Popular methods of T2Reference

  • containsErrors
    Error documents always return true, as do any lists where at least one immediate child of the list r
  • getDepth
    All entities identified by a T2Reference have a conceptual depth. In the case of lists the depth is
  • getLocalPart
    In addition to the namespace the T2Reference contains a local identifier. This identifier is unique
  • getNamespacePart
    T2Reference instances retain a reference to the reference manager which created them in the form of
  • toUri
    All T2Reference instances can be represented as a URI.

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JComboBox (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Join (org.hibernate.mapping)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now