com.j256.simplemagic.entries
Class MagicEntry

java.lang.Object
  extended by com.j256.simplemagic.entries.MagicEntry

public class MagicEntry
extends Object

Representation of a line of information from the magic (5) format. A number of methods are package protected because this is generated by the MagicEntryParser.

Author:
graywatson

Method Summary
 int getLevel()
          Return the "level" of the rule.
 int getStrength()
          Get the strength of the rule.
 ContentInfo processBytes(byte[] bytes)
          Returns the content type associated with the bytes or null if it does not match.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

processBytes

public ContentInfo processBytes(byte[] bytes)
Returns the content type associated with the bytes or null if it does not match.


getLevel

public int getLevel()
Return the "level" of the rule. Level-0 rules start the matching process. Level-1 and above rules are processed only when the level-0 matches.


getStrength

public int getStrength()
Get the strength of the rule. Not well supported right now.


toString

public String toString()
Overrides:
toString in class Object


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.