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

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

Best Java code snippets using net.sf.taverna.t2.reference.T2Reference.containsErrors (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.core/workflowmodel-core-extensions

/**
 * If the job contains errors, or collections which contain errors
 * themselves then bounce a result message with error documents in back up
 * to the layer above
 */
@Override
public void receiveJob(DispatchJobEvent jobEvent) {
  Set<T2Reference> errorReferences = new HashSet<T2Reference>();
  for (T2Reference ei : jobEvent.getData().values()) {
    if (ei.containsErrors()) {
      errorReferences.add(ei);
    }
  }
  if (errorReferences.isEmpty()) {
    // relay the message down...
    getBelow().receiveJob(jobEvent);
  } else {
    getState(jobEvent.getOwningProcess())
    .incrementErrorsReflected();
    sendErrorOutput(jobEvent, null, errorReferences);
  }
}
origin: net.sf.taverna.t2/t2reference-impl

if (id.containsErrors()) {
  throw new ReferenceServiceException(
      "Can't render an identifier which contains errors to a POJO");
origin: net.sf.taverna.t2.core/reference-impl

if (id.containsErrors()) {
  throw new ReferenceServiceException(
      "Can't render an identifier which contains errors to a POJO");
origin: net.sf.taverna.t2/reference-impl

public Object renderIdentifier(T2Reference id, Class<?> leafClass,
    ReferenceContext context) throws ReferenceServiceException {
  // Check we have the services installed
  checkServices();
  // Insert an empty context if context was null
  context = EmptyReferenceContext.checkContext(context);
  // Reject if the source reference contains errors
  if (id.containsErrors()) {
    throw new ReferenceServiceException(
        "Can't render an identifier which contains errors to a POJO");
  }
  // Attempt to find an appropriate StreamToValueConverterSPI instance to
  // build the specified class
  StreamToValueConverterSPI<?> converter = null;
  if (valueBuilderRegistry != null) {
    for (StreamToValueConverterSPI<?> stvc : valueBuilderRegistry) {
      Class<?> builtClass = stvc.getPojoClass();
      if (leafClass.isAssignableFrom(builtClass)) {
        converter = stvc;
        break;
      }
    }
  }
  if (converter == null) {
    log.warn("No stream->value converters found for type '"
        + leafClass.getCanonicalName() + "'");
  }
  // Render the identifier
  return renderIdentifierInner(id, leafClass, context, converter);
}
origin: net.sf.taverna.t2.ui-components/results-view

public boolean isShown(Object o) {
if (!(o instanceof WorkflowResultTreeNode)) {
  return false;
}
WorkflowResultTreeNode node = (WorkflowResultTreeNode) o;
if (filter.equals(FilterType.ALL)) {
  return (true);
}
if (filter.equals(FilterType.RESULTS)) {
  for (Enumeration e = node.depthFirstEnumeration(); e.hasMoreElements();) {
  WorkflowResultTreeNode subNode = (WorkflowResultTreeNode) e.nextElement();
  if ((subNode.getReference() != null) && !subNode.getReference().containsErrors()) {
    return true;
  }
  }
  return false;
}
if (filter.equals(FilterType.ERRORS)) {
  for (Enumeration e = node.depthFirstEnumeration(); e.hasMoreElements();) {
  WorkflowResultTreeNode subNode = (WorkflowResultTreeNode) e.nextElement();
  if ((subNode.getReference() != null) && subNode.getReference().containsErrors()) {
    return true;
  }
  }
  return false;
}
return true;
}
origin: net.sf.taverna.t2/workflowmodel-impl

/**
 * If the job contains errors, or collections which contain errors
 * themselves then bounce a result message with error documents in back up
 * to the layer above
 */
@Override
public void receiveJob(DispatchJobEvent jobEvent) {
  Set<T2Reference> errorReferences = new HashSet<T2Reference>();
  for (T2Reference ei : jobEvent.getData().values()) {
    if (ei.containsErrors()) {
      errorReferences.add(ei);
    }
  }
  if (errorReferences.isEmpty()) {
    // relay the message down...
    getBelow().receiveJob(jobEvent);
  } else {
    getState(jobEvent.getOwningProcess())
    .incrementErrorsReflected();
    sendErrorOutput(jobEvent, null, errorReferences);
  }
}
origin: net.sf.taverna.t2.ui-components/results-view

  private static boolean containsError (TreeNode node) {
    boolean result = false;
    if (node instanceof WorkflowResultTreeNode) {
      WorkflowResultTreeNode rtn = (WorkflowResultTreeNode) node;
      T2Reference reference = rtn.getReference();
      if ((reference != null) && (reference.containsErrors())) {
        result = true;
      }
    }
    int childCount = node.getChildCount();
    for (int i = 0; (i < childCount) && !result; i++ ) {
      result = containsError(node.getChildAt(i));
    }
    return result;
  }
}
origin: net.sf.taverna.t2.ui-components/results-view

  public boolean isShown(Object o) {
  if (!(o instanceof ProcessorResultTreeNode)) {
    return false;
  }
  ProcessorResultTreeNode node = (ProcessorResultTreeNode) o;
  if (node.getReference() == null) {
    // root of the model
    return true;
  }
  if (filter.equals(FilterType.ALL)) {
    return (true);
  }
  if (filter.equals(FilterType.RESULTS)) {
    for (Enumeration e = node.depthFirstEnumeration(); e.hasMoreElements();) {
    ProcessorResultTreeNode subNode = (ProcessorResultTreeNode) e.nextElement();
    if ((subNode.getReference() != null) && !subNode.getReference().containsErrors()) {
      return true;
    }
    }
    return false;
  }
  if (filter.equals(FilterType.ERRORS)) {
    return node.getReference().containsErrors();
  }
  return true;
  }
}
origin: net.sf.taverna.t2.ui-components/results-view

  private static boolean containsError (TreeNode node) {
    boolean result = false;
    if (node instanceof ProcessorResultTreeNode) {
      ProcessorResultTreeNode rtn = (ProcessorResultTreeNode) node;
      T2Reference reference = rtn.getReference();
      if ((reference != null) && (reference.containsErrors())) {
        result = true;
      }
    }
    int childCount = node.getChildCount();
    for (int i = 0; (i < childCount) && !result; i++ ) {
      result = containsError(node.getChildAt(i));
    }
    return result;
  }
}
origin: net.sf.taverna.t2.integration-testing/integration-testing-common

public void resultTokenProduced(WorkflowDataToken dataToken, String portname) {
  if (dataToken.getIndex().length == 0) {
    T2Reference reference = dataToken.getData();
    System.out.println("Output reference made = " + reference);
    Object value = reference;
    if (reference.containsErrors()) {
      System.out.println("Contains errors!");
      printAllErrors(context.getReferenceService().resolveIdentifier(
          reference, null, context));
    } else {
      try {
        value = context.getReferenceService().renderIdentifier(
            reference, Object.class, context);
      } catch (ReferenceServiceException ex) {
        ex.printStackTrace();
      }
    }
    resultMap.put(portname, value);
    synchronized (this) {
      outputCount--;
    }
  }
}
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.integration-testing/integration-testing-common

@SuppressWarnings("unchecked")
public void printAllErrors(Identified identified) {
  if (!identified.getId().containsErrors()) {
    return;
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

/**
 * 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

          + depth);
if (ref.containsErrors()) {
origin: net.sf.taverna.t2/t2reference-impl

          + depth);
if (ref.containsErrors()) {
origin: net.sf.taverna.t2/reference-impl

          + depth);
if (ref.containsErrors()) {
net.sf.taverna.t2.referenceT2ReferencecontainsErrors

Javadoc

Error documents always return true, as do any lists where at least one immediate child of the list returns true when this property is evaluated. As lists are immutable this property is actually set on list registration. This is used to determine whether to allow POJO resolution of the entity identified by this T2Reference - this is configurable by the caller but there will be some cases where an attempt to render a collection containing errors to a POJO should return an error and other occasions when it should return a collection containing error objects.

ReferenceSet implementations always return false.

Popular methods of T2Reference

  • getReferenceType
  • 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

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Kernel (java.awt.image)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for WebStorm
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