📄 pagemetadata.java
字号:
/* * Fire (Flexible Interface Rendering Engine) is a set of graphics widgets for creating GUIs for j2me applications. * Copyright (C) 2006-2008 Bluevibe (www.bluevibe.net) * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */package gr.fire.browser.util;import java.util.Vector;import gr.fire.util.Log;import gr.fire.util.StringUtil;public class PageMetaData{ private String url; private String refresh; private int refreshSeconds; private String pageTitle=null; public PageMetaData(String url) { this.url=url; } public void parseMetaTag(XmlPullParser parser) { //http-equiv="refresh" content="5;url=http://example.com/" String type = parser.getAttributeValue("http-equiv"); if(type==null) return; type = type.toLowerCase(); if(type.equals("refresh")) { String content = parser.getAttributeValue("content"); if(content==null){ refreshSeconds=0; refresh = url; return; } String urlStr = null,delayStr=null; int idx =content.indexOf(";"); if(idx==-1) delayStr = content; else { delayStr = content.substring(0,idx).trim(); urlStr = content.substring(idx+1).trim(); } if(urlStr!=null && urlStr.startsWith("url=")) { refresh = StringUtil.proccessUrl(urlStr.substring(4)); if(refresh.startsWith("'")) refresh= refresh.substring(1,refresh.length()-1); // remove single quotes "'" } if(delayStr!=null)try{ refreshSeconds = Integer.parseInt(delayStr); }catch(NumberFormatException e){} Log.logInfo("MetaRefresh in "+refreshSeconds+" seconds to "+refresh); } } public String getRefresh() { return refresh; } public void setRefresh(String refresh) { this.refresh = refresh; } public int getRefreshSeconds() { return refreshSeconds; } public void setRefreshSeconds(int refreshSeconds) { this.refreshSeconds = refreshSeconds; } public String getPageTitle() { return pageTitle; } public void setPageTitle(String pageTitle) { this.pageTitle = pageTitle; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -