Tabnine Logo
MessageHolder
Code IndexAdd Tabnine to your IDE (free)

How to use
MessageHolder
in
uk.ac.ebi.intact.application.dataConversion.psiUpload.util.report

Best Java code snippets using uk.ac.ebi.intact.application.dataConversion.psiUpload.util.report.MessageHolder (Showing top 20 results out of 315)

origin: uk.ac.ebi.intact.util/data-conversion

  public static void check( final XrefTag xref ) {

    final String db = xref.getDb();

    if ( !cache.keySet().contains( db ) ) {
      CvDatabase cvDatabase = null;
      try {
        cvDatabase = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvDatabase.class, db );

        if ( cvDatabase != null ) {
          System.out.println( "Found CvDatabase with shortlabel: " + db );
        } else {
          MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvDatabase " +
                                        "by shortlabel: " + db ) );
        }
      } catch ( IntactException e ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " +
                                      "for CvDatabase " +
                                      "having the shortlabel: " + db ) );
        e.printStackTrace();
      }

      cache.put( db, cvDatabase );
    }
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

  private static XrefTag createXref( final Element xrefNode, final short type ) {

    XrefTag xref = null;
    try {
      String db = xrefNode.getAttribute( "db" );
      if ( db != null ) {
        db = db.toLowerCase();
      }

      xref = new XrefTag( type,
                xrefNode.getAttribute( "id" ),
                db,
                xrefNode.getAttribute( "secondary" ),
                xrefNode.getAttribute( "version" ) );

    } catch ( IllegalArgumentException e ) {
      MessageHolder.getInstance().addParserMessage( new Message( xrefNode, e.getMessage() ) );
    }

    return xref;
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

public void clearAllMessages() {
  clearParserMessage();
  clearCheckerMessage();
}
origin: uk.ac.ebi.intact.util/data-conversion

final MessageHolder messages = MessageHolder.getInstance();
    entrySet = entrySetParser.process( rootElement );
  } catch ( RuntimeException re ) {
    if ( messages.parserMessageExists() ) {
      System.err.println( "Before to exit, here are the messages creating during the parsing:" );
      messages.printParserReport( System.err );
      System.err.println( "\nPlease fix your file and try again." );
      System.err.println( "abort." );
  if ( messages.parserMessageExists() ) {
    messages.printParserReport( System.err );
    System.err.println( "\nPlease fix your file and try again." );
    System.err.println( "abort." );
    if ( messages.checkerMessageExists() ) {
      MessageHolder.getInstance().printCheckerReport( System.err );
      System.err.println( "abort." );
      System.exit( 1 );
        if ( messages.checkerMessageExists() ) {
          MessageHolder.getInstance().printPersisterReport( System.err );
          System.err.println( "abort." );
          System.exit( 1 );
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

final MessageHolder messages = MessageHolder.getInstance();
    entrySet = entrySetParser.process( rootElement );
  } catch ( RuntimeException re ) {
    if ( messages.parserMessageExists() ) {
      System.err.println( "Before to exit, here are the messages creating during the parsing:" );
      messages.printParserReport( System.err );
      System.err.println( "\nPlease fix your file and try again." );
      System.err.println( "abort." );
  if ( messages.parserMessageExists() ) {
    messages.printParserReport( System.err );
    System.err.println( "\nPlease fix your file and try again." );
    System.err.println( "abort." );
    if ( messages.checkerMessageExists() ) {
      MessageHolder.getInstance().printCheckerReport( System.err );
      System.err.println( "abort." );
      System.exit( 1 );
        if ( messages.checkerMessageExists() ) {
          MessageHolder.getInstance().printPersisterReport( System.err );
          System.err.println( "abort." );
          System.exit( 1 );
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

  public static void check( final XrefTag xref ) {

    final String db = xref.getDb();

    if ( !cache.keySet().contains( db ) ) {
      CvDatabase cvDatabase = null;
      try {
        cvDatabase = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvDatabase.class, db );

        if ( cvDatabase != null ) {
          System.out.println( "Found CvDatabase with shortlabel: " + db );
        } else {
          MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvDatabase " +
                                        "by shortlabel: " + db ) );
        }
      } catch ( IntactException e ) {
        MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " +
                                      "for CvDatabase " +
                                      "having the shortlabel: " + db ) );
        e.printStackTrace();
      }

      cache.put( db, cvDatabase );
    }
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

  private static XrefTag createXref( final Element xrefNode, final short type ) {

    XrefTag xref = null;
    try {
      String db = xrefNode.getAttribute( "db" );
      if ( db != null ) {
        db = db.toLowerCase();
      }

      xref = new XrefTag( type,
                xrefNode.getAttribute( "id" ),
                db,
                xrefNode.getAttribute( "secondary" ),
                xrefNode.getAttribute( "version" ) );

    } catch ( IllegalArgumentException e ) {
      MessageHolder.getInstance().addParserMessage( new Message( xrefNode, e.getMessage() ) );
    }

    return xref;
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

final MessageHolder messages = MessageHolder.getInstance();
    entrySet = entrySetParser.process( rootElement );
  } catch ( RuntimeException re ) {
    if ( messages.parserMessageExists() ) {
      System.err.println( "Before to exit, here are the messages creating during the parsing:" );
      messages.printParserReport( System.err );
      System.err.println( "\nPlease fix your file and try again." );
      System.err.println( "abort." );
  if ( messages.parserMessageExists() ) {
    messages.printParserReport( System.err );
    System.err.println( "\nPlease fix your file and try again." );
    System.err.println( "abort." );
    if ( messages.checkerMessageExists() ) {
      MessageHolder.getInstance().printCheckerReport( System.err );
      System.err.println( "abort." );
      System.exit( 1 );
        if ( messages.checkerMessageExists() ) {
          MessageHolder.getInstance().printPersisterReport( System.err );
          System.err.println( "abort." );
          System.exit( 1 );
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

public void clearAllMessages() {
  clearParserMessage();
  clearCheckerMessage();
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

public static void checkCvInteractorType( ) {
  if ( false == interatorTypeChecked ) {
    // Load CvInteractorType( interaction / MI: )
    cvInteractionType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractorType.class, CvInteractorType.getInteractionMI());
    if ( cvInteractionType == null ) {
      MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) );
    }
    interatorTypeChecked = true;
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

  /**
   * Process a &lt;cellType&gt; in an organism. <br> In order to map it to the IntAct data, we look for the psi-mi
   * <code>primaryRef</code>, and look-up in intact using its <code>id</code>.
   *
   * @param element &lt;cellType&gt;.
   *
   * @return a <code>CellTypeTag</code> if the XML contains a walid psi-mi descriptor.
   *
   * @see uk.ac.ebi.intact.application.dataConversion.psiUpload.model.CellTypeTag
   */
  public static ConfidenceTag process( final Element element ) {

    if ( false == "confidence".equals( element.getNodeName() ) ) {
      MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in confidence tag." ) );
    }

    String unit = element.getAttribute( "unit" );
    String value = element.getAttribute( "value" );

    ConfidenceTag confidenceTag = null;
    try {
      confidenceTag = new ConfidenceTag( unit, value );
    } catch ( IllegalArgumentException e ) {
      MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) );
    }

    return confidenceTag;
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

public void clearAllMessages() {
  clearParserMessage();
  clearCheckerMessage();
}
origin: uk.ac.ebi.intact.app/data-conversion

  MessageHolder.getInstance().addCheckerMessage( new Message( "Found more than one BioSource (expressedIn) " +
                                "having the shortlabel: " + shortlabel ) );
} else if ( bioSources.size() == 0 ) {
  MessageHolder.getInstance().addCheckerMessage( new Message( "Found no BioSource (expressedIn) " +
                                "having the shortlabel: " + shortlabel ) );
MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " +
                              "for BioSource (expressedIn)" +
                              "having the shortlabel: " + shortlabel ) );
origin: uk.ac.ebi.intact.app/data-conversion

  private static XrefTag createXref( final Element xrefNode, final short type ) {

    XrefTag xref = null;
    try {
      String db = xrefNode.getAttribute( "db" );
      if ( db != null ) {
        db = db.toLowerCase();
      }

      xref = new XrefTag( type,
                xrefNode.getAttribute( "id" ),
                db,
                xrefNode.getAttribute( "secondary" ),
                xrefNode.getAttribute( "version" ) );

    } catch ( IllegalArgumentException e ) {
      MessageHolder.getInstance().addParserMessage( new Message( xrefNode, e.getMessage() ) );
    }

    return xref;
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

  MessageHolder.getInstance().addCheckerMessage( new Message( "Found more than one BioSource (expressedIn) " +
                                "having the shortlabel: " + shortlabel ) );
} else if ( bioSources.size() == 0 ) {
  MessageHolder.getInstance().addCheckerMessage( new Message( "Found no BioSource (expressedIn) " +
                                "having the shortlabel: " + shortlabel ) );
MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " +
                              "for BioSource (expressedIn)" +
                              "having the shortlabel: " + shortlabel ) );
origin: uk.ac.ebi.intact.app/data-conversion

  /**
   * Process a &lt;cellType&gt; in an organism. <br> In order to map it to the IntAct data, we look for the psi-mi
   * <code>primaryRef</code>, and look-up in intact using its <code>id</code>.
   *
   * @param element &lt;cellType&gt;.
   *
   * @return a <code>CellTypeTag</code> if the XML contains a walid psi-mi descriptor.
   *
   * @see uk.ac.ebi.intact.application.dataConversion.psiUpload.model.CellTypeTag
   */
  public static ConfidenceTag process( final Element element ) {

    if ( false == "confidence".equals( element.getNodeName() ) ) {
      MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in confidence tag." ) );
    }

    String unit = element.getAttribute( "unit" );
    String value = element.getAttribute( "value" );

    ConfidenceTag confidenceTag = null;
    try {
      confidenceTag = new ConfidenceTag( unit, value );
    } catch ( IllegalArgumentException e ) {
      MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) );
    }

    return confidenceTag;
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

  MessageHolder.getInstance().addCheckerMessage( new Message( "Found more than one BioSource (expressedIn) " +
                                "having the shortlabel: " + shortlabel ) );
} else if ( bioSources.size() == 0 ) {
  MessageHolder.getInstance().addCheckerMessage( new Message( "Found no BioSource (expressedIn) " +
                                "having the shortlabel: " + shortlabel ) );
MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " +
                              "for BioSource (expressedIn)" +
                              "having the shortlabel: " + shortlabel ) );
origin: uk.ac.ebi.intact.dataexchange.psimi.legacy/data-conversion

  /**
   * Process a &lt;cellType&gt; in an organism. <br> In order to map it to the IntAct data, we look for the psi-mi
   * <code>primaryRef</code>, and look-up in intact using its <code>id</code>.
   *
   * @param element &lt;cellType&gt;.
   *
   * @return a <code>CellTypeTag</code> if the XML contains a walid psi-mi descriptor.
   *
   * @see uk.ac.ebi.intact.application.dataConversion.psiUpload.model.CellTypeTag
   */
  public static ConfidenceTag process( final Element element ) {

    if ( false == "confidence".equals( element.getNodeName() ) ) {
      MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in confidence tag." ) );
    }

    String unit = element.getAttribute( "unit" );
    String value = element.getAttribute( "value" );

    ConfidenceTag confidenceTag = null;
    try {
      confidenceTag = new ConfidenceTag( unit, value );
    } catch ( IllegalArgumentException e ) {
      MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) );
    }

    return confidenceTag;
  }
}
origin: uk.ac.ebi.intact.util/data-conversion

public static void checkCvInteractorType( ) {
  if ( false == interatorTypeChecked ) {
    // Load CvInteractorType( interaction / MI: )
    cvProteinType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractorType.class, CvInteractorType.getInteractionMI());
    if ( cvProteinType == null ) {
      MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) );
    }
    interatorTypeChecked = true;
  }
}
origin: uk.ac.ebi.intact.app/data-conversion

  /**
   * Take &lt;featureList&gt; in parameter.
   *
   * @param element
   */
  public static Collection process( final Element element ) {

    Collection features = new ArrayList( 2 );

    final String name = element.getNodeName();
    if ( false == "featureList".equals( name ) ) {
      MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in a " +
                                        "featureList tag." ) );
      // TODO should we carry on here ? If the tag is not right ... the parsing can only fail !
    }

    final NodeList someFeatures = element.getElementsByTagName( "feature" );
    final int count = someFeatures.getLength();

    for ( int i = 0; i < count; i++ ) {
      final Node featureNode = someFeatures.item( i );

      final FeatureTag feature = FeatureParser.process( (Element) featureNode );

      features.add( feature );
    } // features

    return features;
  }
}
uk.ac.ebi.intact.application.dataConversion.psiUpload.util.reportMessageHolder

Javadoc

That class hold messages created during the Paring and checking process.

Most used methods

  • addCheckerMessage
  • addParserMessage
  • checkerMessageExists
  • clearCheckerMessage
  • clearParserMessage
  • getInstance
  • parserMessageExists
  • printCheckerReport
  • printParserReport
  • printPersisterReport
  • printReport
  • printReport

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Reference (javax.naming)
  • BoxLayout (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Sublime Text plugins
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