Tabnine Logo
Magic.printMagicMatcher
Code IndexAdd Tabnine to your IDE (free)

How to use
printMagicMatcher
method
in
net.sf.jmimemagic.Magic

Best Java code snippets using net.sf.jmimemagic.Magic.printMagicMatcher (Showing top 4 results out of 315)

origin: jmimemagic/jmimemagic

/**
 * print a magic match
 *
 * @param stream DOCUMENT ME!
 * @param matcher DOCUMENT ME!
 * @param spacing DOCUMENT ME!
 */
private static void printMagicMatcher(PrintStream stream, MagicMatcher matcher, String spacing)
{
  stream.println(spacing + "name: " + matcher.getMatch().getDescription());
  stream.println(spacing + "children: ");
  Collection matchers = matcher.getSubMatchers();
  Iterator i = matchers.iterator();
  while (i.hasNext()) {
    printMagicMatcher(stream, (MagicMatcher) i.next(), spacing + "  ");
  }
}
origin: arimus/jmimemagic

/**
 * print the contents of a magic file
 *
 * @param stream DOCUMENT ME!
 *
 * @throws MagicParseException DOCUMENT ME!
 */
public static void printMagicFile(PrintStream stream)
  throws MagicParseException
{
  if (!initialized) {
    initialize();
  }
  Collection<MagicMatcher> matchers = Magic.getMatchers();
  log.debug("have " + matchers.size() + " matches");
  MagicMatcher matcher = null;
  Iterator<MagicMatcher> i = matchers.iterator();
  while (i.hasNext()) {
    matcher = (MagicMatcher) i.next();
    log.debug("printing");
    printMagicMatcher(stream, matcher, "");
  }
}
origin: jmimemagic/jmimemagic

/**
 * print the contents of a magic file
 *
 * @param stream DOCUMENT ME!
 *
 * @throws MagicParseException DOCUMENT ME!
 */
public static void printMagicFile(PrintStream stream)
  throws MagicParseException
{
  if (!initialized) {
    initialize();
  }
  Collection matchers = Magic.getMatchers();
  log.debug("have " + matchers.size() + " matches");
  MagicMatcher matcher = null;
  Iterator i = matchers.iterator();
  while (i.hasNext()) {
    matcher = (MagicMatcher) i.next();
    log.debug("printing");
    printMagicMatcher(stream, matcher, "");
  }
}
origin: arimus/jmimemagic

/**
 * print a magic match
 *
 * @param stream DOCUMENT ME!
 * @param matcher DOCUMENT ME!
 * @param spacing DOCUMENT ME!
 */
private static void printMagicMatcher(PrintStream stream, MagicMatcher matcher, String spacing)
{
  stream.println(spacing + "name: " + matcher.getMatch().getDescription());
  stream.println(spacing + "children: ");
  Collection<MagicMatcher> matchers = matcher.getSubMatchers();
  Iterator<MagicMatcher> i = matchers.iterator();
  while (i.hasNext()) {
    printMagicMatcher(stream, (MagicMatcher) i.next(), spacing + "  ");
  }
}
net.sf.jmimemagicMagicprintMagicMatcher

Javadoc

print a magic match

Popular methods of Magic

  • getMagicMatch
    get a match from a stream of data
  • addHint
    Add a hint to use the specified matcher for the given extension
  • initialize
    create a parser and initialize it
  • getMatchers
    return the parsed MagicMatch objects that were created from the magic.xml definitions
  • printMagicMatch
    print a magic match

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top PhpStorm 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