|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j256.simplemagic.types.DefaultType
public class DefaultType
This is intended to be used with the test x (which is always true) and a message that is to be used if there are no other matches.
WARNING: This type _is_ used in the magic files.
Constructor Summary | |
---|---|
DefaultType()
|
Method Summary | |
---|---|
Object |
convertTestString(String typeStr,
String testStr,
int offset)
Converts the test-string from the magic line to be an object to be passed into MagicMatcher.isMatch(Object, Long, boolean, Object, int, byte[]) . |
Object |
extractValueFromBytes(int offset,
byte[] bytes)
Extract the value from the bytes. |
Object |
isMatch(Object testValue,
Long andValue,
boolean unsignedType,
Object extractedValue,
int offset,
byte[] bytes)
Matches if the bytes match at a certain offset. |
void |
renderValue(StringBuilder sb,
Object extractedValue,
Formatter formatter)
Returns the string version of the extracted value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultType()
Method Detail |
---|
public Object convertTestString(String typeStr, String testStr, int offset)
MagicMatcher
MagicMatcher.isMatch(Object, Long, boolean, Object, int, byte[])
.
convertTestString
in interface MagicMatcher
public Object extractValueFromBytes(int offset, byte[] bytes)
MagicMatcher
extractValueFromBytes
in interface MagicMatcher
MagicMatcher.isMatch(Object, Long, boolean, Object, int, byte[])
or null if not
enough bytes.public Object isMatch(Object testValue, Long andValue, boolean unsignedType, Object extractedValue, int offset, byte[] bytes)
MagicMatcher
isMatch
in interface MagicMatcher
public void renderValue(StringBuilder sb, Object extractedValue, Formatter formatter)
MagicMatcher
renderValue
in interface MagicMatcher
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |