関数使用例(Java 版)

Yubin7 Toolkit は 2017 年 10 月 30 日 をもって販売を終了いたしました。

関数名をクリックするとコード例を表示します。

ZipDic.java が提供する関数一覧

GetZipAddress 郵便番号を元に郵便番号辞書から該当する住所文字列を取得します。
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="advZipDic.ZipDic"%>
<%
    // 郵便番号を元に住所データを取得
    String zipcode = "918-8239";
    Map[] result = new ZipDic().GetZipAddress(zipcode);
%>
<html> 
    <head> 
        <title>GetZipAddress 関数 - サンプルソース</title> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    </head> 
    <body> 
        <%
            // 結果を表示 
            out.print("7桁郵便場号 : " + result[0].get("ZipCode") + "<br>");
            out.print("市町村コード : " + result[0].get("CityCode") + "<br>");
            out.print("都道府県 : " + result[0].get("PrefName") + "<br>");
            out.print("市名1 : " + result[0].get("CountyName") + "<br>");
            out.print("市名2 : " + result[0].get("CityName") + "<br>");
            out.print("町域名 : " + result[0].get("TownName"));
        %> 
    </body> 
</html>

ZipDic2.java が提供する関数一覧

Yubin7 住所文字列を元に郵便番号辞書から該当する郵便番号を取得します。
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="advZipDic.ZipDic2"%>
<%
    // 住所データを元に郵便番号を取得
    String address = "福井県福井市成和1丁目2816番地";
    Map result = new ZipDic2().Yubin7(address);
%>
<html> 
    <head> 
        <title>GetZipAddress 関数 - サンプルソース</title> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    </head> 
    <body> 
        <%
            // 結果を表示 
            out.print("ステータス(取得有無) : " + result.get("Status") + "<br>");
            out.print("7桁郵便場号 : " + result.get("ZipCode") + "<br>");
            out.print("市町村コード : " + result.get("CityCode") + "<br>");
            out.print("都道府県 : " + result.get("PrefName") + "<br>");
            out.print("市名1 : " + result.get("CountyName") + "<br>");
            out.print("市名2 : " + result.get("CityName") + "<br>");
            out.print("町域名 : " + result.get("TownName") + "<br>");
            out.print("町域以降 : " + result.get("Number") + "<br>");
            out.print("エラー詳細 : " + result.get("Error"));
        %> 
    </body> 
</html>

ZipDicProp.java が提供する関数一覧

GetDicDownloadURL 製品シリアルNo と指定した郵便番号辞書のバージョンを元に、辞書ダウンロード用 URL を取得します。
取得された URL にアクセスすることで最新の郵便番号辞書をダウンロードすることが可能です。
<%@page contentType="text/html" pageEncoding="UTF-8"%> 
<%@page import="advZipDic.ZipDicProp"%> 
<% 
    String serial = "12345678";         // シリアルNo
    String dicVersion = "161.0.0.01 ";  // 辞書バージョン
    /* GetDicVersion 関数との併用例  
     * 郵便番号辞書(AdvZip.Dic)ファイルバージョン取得  
     * String dicVersion = new ZipDicProp().GetDicVersion("dicVersion");  
     */ 

    // 郵便番号辞書ダウンロード専用 URL の取得  
    String url = new ZipDicProp().GetDicDownloadURL(serial, dicVersion); 
%>  
<html>  
    <head>  
        <title>GetDicDownloadURL 関数 - サンプルソース</title>  
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    </head>  
    <body>  
        <% 
            // 結果を表示  
            out.print("ダウンロードサイト URL : " + url); 
        %>  
    </body>  
</html>
GetDicVersion 指定した郵便番号辞書のバージョン情報を取得します。
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="advZipDic.ZipDicProp"%>
<%
    // 郵便番号辞書(AdvZip.Dic)ファイルバージョン取得 
    String dicVersion = new ZipDicProp().GetDicVersion("dicVersion");           // 辞書バージョン 
    String releaseData = new ZipDicProp().GetDicVersion("releaseDate");         // データ公開日 
    String assureDate = new ZipDicProp().GetDicVersion("assureDate");           // データ保障日 
    String createDate = new ZipDicProp().GetDicVersion("createDate");           // ファイル生成日 
    String advZipDicClass = new ZipDicProp().GetDicVersion("advZipDicClass");   // AdvZipDicクラスバージョン 
%> 
<html> 
    <head> 
        <title>GetDicVersion 関数 - サンプルソース</title> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    </head> 
    <body> 
        <%
            // 結果を表示 
            out.print("辞書バージョン : " + dicVersion + "<br>");
            out.print("データ公開日 : " + releaseData + "<br>");
            out.print("データ保障日 : " + assureDate + "<br>");
            out.print("ファイル生成日 : " + createDate + "<br>");
            out.print("AdvZipDicクラスバージョン : " + advZipDicClass);
        %> 
    </body> 
</html>

提供関数の実際の動作を確認することが可能な動作デモページを公開しております。