/* * [HttpTokenizer.java] * * Summary: Decides which extensions will be processed by the http parser. * * Copyright: (c) 2004-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2010-02-10 initial version. */ package com.mindprod.jprep; import com.mindprod.jtokens.Token; /** * Decides which extensions will be processed by the http parser. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2010-02-10 initial version. * @since 2010-02-10 */ public final class HttpTokenizer implements JPrepTokenizer { /** * Constructor */ public HttpTokenizer() { } /** * @inheritDoc */ public String[] getExtensions() { // handles http text headers files of form fieldname: value return new String[] { "http", "httpfrag" }; } /** * Parse program and return array of tokens * * @param big the entire program or fragment to parse. * * @return array of tokens encoding colour and font. */ public Token[] tokenize( String big ) { return HttpParser.parse( big ); } }