org.mmbase.util.magicfile
Class XmlDetector

java.lang.Object
  extended by org.mmbase.util.magicfile.AbstractDetector
      extended by org.mmbase.util.magicfile.XmlDetector
All Implemented Interfaces:
Detector

public class XmlDetector
extends AbstractDetector

A detector which can match on XML namespaces, publicId.

Since:
MMBase-1.9.3
Version:
$Id: XmlDetector.java 41760 2010-04-03 15:18:20Z michiel $
Author:
Michiel Meeuwissen

Nested Class Summary
protected  class XmlDetector.Handler
           
protected  class XmlDetector.Matched
          In case a match is found, this exception is thrown and further parsing is interrupted.
 
Field Summary
protected  String namespace
           
protected  Pattern publicId
           
 
Fields inherited from class org.mmbase.util.magicfile.AbstractDetector
childList, message, valid
 
Constructor Summary
XmlDetector()
           
 
Method Summary
 void configure(Element el)
           
 void setPublicId(String dt)
           
 void setXmlns(String xmlns)
           
 boolean test(byte[] lithmus)
           
 
Methods inherited from class org.mmbase.util.magicfile.AbstractDetector
addChild, getDesignation, getExtension, getExtensions, getMimeType, setDesignation, setExtension, setMimeType, setValid, toString, valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

namespace

protected String namespace

publicId

protected Pattern publicId
Constructor Detail

XmlDetector

public XmlDetector()
Method Detail

setXmlns

public void setXmlns(String xmlns)

setPublicId

public void setPublicId(String dt)

test

public boolean test(byte[] lithmus)
Returns:
Whether detector matches the prefix/lithmus of the file

configure

public void configure(Element el)
Specified by:
configure in interface Detector
Overrides:
configure in class AbstractDetector


MMBase 2.0-SNAPSHOT - null