If you think the Android project Viz listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright 2012-2014, First Three LLC//fromwww.java2s.com
*
* This file is a part of Viz.
*
* Viz is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Viz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Viz. If not, see <http://www.gnu.org/licenses/>.
*/package com.first3.viz.builders;
import java.net.URL;
import android.webkit.WebView;
import com.first3.viz.models.Resource;
import com.first3.viz.utils.FetchContainerTask;
publicinterface ResourceBuilder {
/*
* Steps to use:
* a) Retrieve a ResourceBuilder from ContentSources.
*
* b) Confirm it has content by calling hasContent
*
* c) Determine if the download should load the container page. If
* it should, return false from shouldInterceptPageLoad,
* otherwise return false.
*
* d) Check if this is a direct link to data or a link
* to a url that contains the data by calling
* isContainerURL.
*
* e) If container url, call fetchContainer() in a new thread.
* if fetchContainer() returns true, download can proceed,
* otherwise an error occured. An error message can be
* retrieved by calling getErrorMessage();
* If fetchContainer was sucessful getTitle(), getDefaultFilename()
* and getDownloadURL() will return valid valus.
*
* Note ResourceBuilders are not thread safe.
*/publicboolean canParse();
publicboolean shouldInterceptPageLoad();
publicboolean isContainerURL();
publicboolean fetchContainer(FetchContainerTask task);
public String getTitle(WebView wv);
/**
* The filename generated by the ResourceBuilder.
*
* The filename should be a good start for a filename, but changable
* by the user.
*/public String getDefaultFilename(WebView wv);
public String getErrorMessage();
/**
* The filename supplied by the user.
*/publicvoid setFilename(String filename);
/**
* Construct a Resource.
*
* This will throw an IOException if fetchContainer has not been called
* or if fetchContainer returned false.
*/public Resource build();
@Override
public String toString();
publicboolean isJSType();
publicvoid injectJS(WebView wv);
publicvoid setTitle(String title);
publicvoid setURL(URL url);
}