亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xercesregpopulator.java

?? JavaPOS的最新版本!這是源代碼!零售業的請看!
?? JAVA
字號:
package jpos.config.simple.xml;

///////////////////////////////////////////////////////////////////////////////
//
// This software is provided "AS IS".  The JavaPOS working group (including
// each of the Corporate members, contributors and individuals)  MAKES NO
// REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
// NON-INFRINGEMENT. The JavaPOS working group shall not be liable for
// any damages suffered as a result of using, modifying or distributing this
// software or its derivatives. Permission to use, copy, modify, and distribute
// the software and its documentation for any purpose is hereby granted. 
//
// The JavaPOS Config/Loader (aka JCL) is now under the CPL license, which 
// is an OSS Apache-like license.  The complete license is located at:
//    http://oss.software.ibm.com/developerworks/opensource/license-cpl.html
//
///////////////////////////////////////////////////////////////////////////////

import java.io.*;
import java.util.*;

import java.io.FileInputStream;

import org.w3c.dom.*;
                  
import org.xml.sax.InputSource;

import jpos.config.*;
import jpos.config.simple.*;
import jpos.util.*;
import jpos.util.tracing.Tracer;
import jpos.util.tracing.TracerFactory;

/**
 * Simple implementation of the JposRegPopulator that loads and saves 
 * the entries in XML using the "jpos/res/jcl.dtd" DTD and the XML4J 
 * (Xerces) API 
 * NOTE: this class must define a public no-argument ctor so that it may be 
 * created via reflection when its defined in the jpos.properties as 
 * the jpos.config.regPopulatorClass
 * @see jpos.util.JposProperties#JPOS_REG_POPULATOR_CLASS_PROP_NAME
 * @since 1.2 (NY 2K meeting)
 * @author E. Michael Maximilien (maxim@us.ibm.com)
 */
public class XercesRegPopulator extends AbstractXercesRegPopulator
{
    //-------------------------------------------------------------------------
    // Ctor(s)
    //

    /**
     * Default ctor
     * @since 1.2 (NY 2K meeting)
     */
    public XercesRegPopulator() 
    { super( XercesRegPopulator.class.getName() ); }

    /**
     * 1-arg constructor that takes the unique ID
	 * @param s the unique ID string
     * @since 1.3 (Washington DC 2001)
     */
    public XercesRegPopulator( String s ) { super( s ); }

    //-------------------------------------------------------------------------
    // Public methods
    //

	/**
	 * @return the fully qualified class name implementing the 
	 * JposRegPopulator interface
	 * @since 1.3 (Washington DC 2001 meeting)
	 */
	public String getClassName() 
	{ return XercesRegPopulator.class.getName(); }

    /**
     * Tell the populator to load the entries 
     * @since 1.2 (NY 2K meeting)
     */
    public void load()
    {
    	tracer.println( "load(): isPopulatorFileDefined=" + 
    					isPopulatorFileDefined() );    	
    	
        if( isPopulatorFileDefined() == false )
        {        	
            getJposEntries().clear();
            xmlFileName = DEFAULT_XML_FILE_NAME;
			load( xmlFileName );

            return;
        }

        try
        {
            getJposEntries().clear();

            domParser.setEntityResolver(new XercesRegPopulator.JPOSDTDEntityResolver());

            domParser.parse( new InputSource( getPopulatorFileIS() ) );

            Document document = domParser.getDocument();

            Enumeration entries = extractJposEntries( document );

            while( entries.hasMoreElements() )
            {
                JposEntry jposEntry = (JposEntry)entries.nextElement();

                if( jposEntry.hasPropertyWithName( JposEntry.
                                                   LOGICAL_NAME_PROP_NAME ) )
					getJposEntries().put( jposEntry.getLogicalName(), 
					                      jposEntry );
            }

			lastLoadException = null;
        }
        catch( Exception e )
        {
			lastLoadException = e;
			tracer.println( "Error loading XML file.  Exception.msg = " + 
			                e.getMessage() ); 
		}
        finally
        { }
    }

    /**
     * Loads the entries specified in the xmlFileName
     * @param xmlFileName the XML file name
     * @since 1.3 (SF 2K meeting)
     */
    public void load( String xmlFileName )
    {
    	tracer.println( "load: xmlFileName=" + xmlFileName );
    	
		InputStream is = null;
		File xmlFile = new File( xmlFileName );

		try
		{
			if( xmlFile.exists() )
				is = new FileInputStream( xmlFile );
			else
				is = findFileInClasspath( xmlFileName );
			
			if (is == null)
			{
				is = getClass().getClassLoader().getResourceAsStream(xmlFileName);
			}

			if( is == null )
			{
				getJposEntries().clear();

				tracer.println( "Could not find file: " + xmlFileName + 
				                " in path or CLASSPATH" );

				lastLoadException = new FileNotFoundException( xmlFileName );
				
				return;
			}

			lastLoadException = null;
		}
		catch( Exception e )
		{
			lastLoadException = e;
			tracer.println( "Error loading XML file.  Exception.message = " + 
			                e.getMessage() ); 
		}

        try
        {
			getJposEntries().clear();

            domParser.setEntityResolver(new XercesRegPopulator.JPOSDTDEntityResolver());

            domParser.parse( new InputSource( is ) );
            
            Document document = domParser.getDocument();

            Enumeration entries = extractJposEntries( document );

            while( entries.hasMoreElements() )
            {
                JposEntry jposEntry = (JposEntry)entries.nextElement();

                if( jposEntry.hasPropertyWithName( JposEntry.
                                                   LOGICAL_NAME_PROP_NAME ) )
                    getJposEntries().put( jposEntry.getLogicalName(),
                                          jposEntry );
            }

			lastLoadException = null;

        }
        catch( Exception e )
        {
			lastLoadException = e;
			tracer.println( "Error loading XML file.  Exception.message = " + 
			                e.getMessage() ); 
		}
		finally
        { }
    }

	/**
	 * @return the name of this populator.  This should be a short descriptive name
	 * @since 1.3 (Washington DC 2001 meeting)
	 */
	public String getName() { return XERCES_REG_POPULATOR_NAME_STRING; }

    //--------------------------------------------------------------------------
    // Protected methods
    //

    /**
     * @return an enumeration of JposEntry objects read from the XML document object
     * @param document the XML document object
     * @since 1.2 (NY 2K meeting)
     */
    protected Enumeration extractJposEntries( Document document )
    {
        Vector entries = new Vector();

		NodeList nodeList = document.getElementsByTagName( "JposEntry" );

		String currentEntryLogicalName = "";

		try
		{
			for( int i = 0; i < nodeList.getLength(); ++i )
			{
				Node node = nodeList.item( i );

				if( node.getNodeType() != Node.ELEMENT_NODE )
					continue;

				JposEntry jposEntry = new SimpleEntry();

				Element jposEntryElement = (Element)node;

				currentEntryLogicalName = jposEntryElement.
				                          getAttribute( "logicalName" );
				jposEntry.addProperty( "logicalName", currentEntryLogicalName );

				NodeList childList = nodeList.item( i ).getChildNodes();

				for( int j = 0; j < childList.getLength(); ++j )
				{
					Node child = childList.item( j );

					if( child.getNodeType() != Node.ELEMENT_NODE )
						continue;

					Element element = (Element)child;

					String elementName = element.getNodeName();

					if( elementName.equals( "creation" ) )
						extractCreationAttr( jposEntry, element );
					else
					if( elementName.equals( "vendor" ) )
						extractVendorAttr( jposEntry, element );
					else
					if( elementName.equals( "jpos" ) )
						extractJposAttr( jposEntry, element );
					else
					if( elementName.equals( "product" ) )
						extractProductAttr( jposEntry, element );
					else
						extractPropAttr( jposEntry, element );
				}

				if( JposEntryUtility.isValidJposEntry( jposEntry ) )
					entries.addElement( jposEntry );
				else
				{
					String msg = "JposEntry with logicalName: " + 
					             currentEntryLogicalName +
					             " is not valid (missing required properties)";
					throw new JposConfigException( msg );
				}
			}
		}
		catch( JposConfigException jce )
		{
			tracer.println( "Skipping invalid entry with logicalName: " + 
			                currentEntryLogicalName );
			tracer.println( "--->JposConfigException.message = " + 
			                jce.getMessage() );

			tracer.print( jce );
			
			if( jce.getOrigException() != null ) 
				tracer.print( jce.getOrigException() );
		}

        return entries.elements();
    }

    /**
     * Get the <creation> element attributes and adds corresponding 
     * properties to JposEntry
     * @param jposEntry the entry to add properties to
     * @param element the <creation> XML element
     * @since 1.2 (NY 2K meeting)
     */
    protected void extractCreationAttr( JposEntry jposEntry, Element element )
    {
        jposEntry.addProperty( "serviceInstanceFactoryClass", 
                               element.getAttribute( "factoryClass" ) );
                               
        jposEntry.addProperty( "serviceClass", 
                               element.getAttribute( "serviceClass" ) );
    }

    /**
     * Get the <vendor> element attributes and adds corresponding 
     * properties to JposEntry
     * @param jposEntry the entry to add properties to
     * @param element the <vendor> XML element
     * @since 1.2 (NY 2K meeting)
     */
    protected void extractVendorAttr( JposEntry jposEntry, Element element )
    {
        jposEntry.addProperty( "vendorName", element.getAttribute( "name" ) );
        jposEntry.addProperty( "vendorURL", element.getAttribute( "url" ) );
    }

    /**
     * Get the <jpos> element attributes and adds corresponding properties 
     * to JposEntry
     * @param jposEntry the entry to add properties to
     * @param element the <jpos> XML element
     * @since 1.2 (NY 2K meeting)
     */
    protected void extractJposAttr( JposEntry jposEntry, Element element )
    {
        jposEntry.addProperty( "jposVersion", 
                               element.getAttribute( "version" ) );
                               
        jposEntry.addProperty( "deviceCategory", 
                               element.getAttribute( "category" ) );
    }

    /**
     * Get the <product> element attributes and adds corresponding 
     * properties to JposEntry
     * @param jposEntry the entry to add properties to
     * @param element the <product> XML element
     * @since 1.2 (NY 2K meeting)
     */
    protected void extractProductAttr( JposEntry jposEntry, Element element )
    {
        jposEntry.addProperty( "productName", element.getAttribute( "name" ) );
        
        jposEntry.addProperty( "productDescription", 
                               element.getAttribute( "description" ) );
        
        jposEntry.addProperty( "productURL", element.getAttribute( "url" ) );
    }

    /**
     * Get the <prop> element attributes and adds corresponding properties 
     * to JposEntry
     * @param jposEntry the entry to add properties to
     * @param element the <prop> XML element
     * @since 1.2 (NY 2K meeting)
	 * @throws jpos.config.JposConfigException if the property value does 
	 * not match the type or is not a valid value (like for instance 
	 * an invalid number)
     */
    protected void extractPropAttr( JposEntry jposEntry, Element element ) 
    throws JposConfigException
    {
		String propName = element.getAttribute( "name" );
		String propValueString = element.getAttribute( "value" );
		String propTypeString = element.getAttribute( "type" );

		if( propTypeString.equals( "" ) ) propTypeString = "String";

		Object propValue = null;
		Class propType = null;

		try
		{
			propType = Class.forName( ( propTypeString.
			                            startsWith( "java.lang." ) ? 
			                            propTypeString :
			                            "java.lang." + propTypeString ) ); 
		}
		catch( ClassNotFoundException cnfe )
		{ 
			throw new JposConfigException( "Invalid property type: " + 
			                                propTypeString + 
			                                " for property named: " + 
			                                propName , cnfe ); 
		}

		if( JposEntryUtility.isValidPropType( propType ) == false )
			throw new JposConfigException( "Invalid property type: " + 
											propTypeString + 
											" for property named: " + 
											propName );

		propValue = JposEntryUtility.
		            parsePropValue( propValueString, propType );

		if( JposEntryUtility.validatePropValue( propValue, propType ) == false )
			throw new JposConfigException( "Invalid property type: " + 
			                                propTypeString + 
			                                " for property named: " + 
			                                propName );

        jposEntry.add( jposEntry.createProp( propName, propValue, propType ) );
    }
    
    /**
     * JposDTDEntityResolver to resolve DTD
     */
    public class JPOSDTDEntityResolver implements org.xml.sax.EntityResolver
    {
        /**
		 * @return the DTD as an InputSource if it is found in a JAR
		 * file in the CLASSPATH otherwise return null
		 */
        public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException, java.io.IOException
        {
            if (publicId.equals("-//JavaPOS//DTD//EN"))
            {
				InputStream is = getClass().getResourceAsStream( DTD_JAR_FILE_NAME );
                    
				if (is != null)
				{
					return (new org.xml.sax.InputSource(new InputStreamReader(is)));
				}
			}
            
            return null;
        }
        
    }
    
    //--------------------------------------------------------------------------
    // Instance variables
    //

    private Tracer tracer = TracerFactory.getInstance().
                             createTracer( "XercesRegPopulator" );

    //--------------------------------------------------------------------------
    // Public constants
    //

    public static final String DTD_JAR_FILE_NAME = "/jpos/res/jcl.dtd";

	public static final String XERCES_REG_POPULATOR_NAME_STRING = 
	                             "JCL XML Entries Populator";
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜久久久久| 久久日一线二线三线suv| 国产麻豆精品视频| 久久99精品国产麻豆婷婷洗澡| 一区二区三区视频在线观看| 亚洲欧美在线高清| 亚洲欧美在线aaa| 亚洲免费毛片网站| 一区二区三区在线观看网站| 亚洲精选视频在线| 一区二区三区四区五区视频在线观看| 亚洲精品中文在线| 亚洲国产一二三| 青青草原综合久久大伊人精品优势| 日本午夜一区二区| 国产精品一区久久久久| 丁香婷婷综合激情五月色| 成人黄色国产精品网站大全在线免费观看| 国产91精品一区二区麻豆网站| 成人午夜免费电影| 在线观看免费成人| 日韩免费看的电影| 国产精品久久久久久妇女6080| 亚洲三级免费电影| 五月天婷婷综合| 国产一区二区免费视频| jizzjizzjizz欧美| 欧美精品久久久久久久多人混战 | 色www精品视频在线观看| 欧美三级三级三级| 久久久五月婷婷| 一二三四社区欧美黄| 狠狠色综合播放一区二区| caoporm超碰国产精品| 7777精品久久久大香线蕉| 国产日韩欧美在线一区| 夜夜亚洲天天久久| 国产成人精品午夜视频免费| 欧美男生操女生| 国产农村妇女毛片精品久久麻豆 | 天天综合网 天天综合色| 精品亚洲免费视频| 91国产成人在线| 精品少妇一区二区三区在线播放| 亚洲欧洲精品一区二区三区| 美腿丝袜亚洲综合| 一本久久a久久免费精品不卡| 久久综合成人精品亚洲另类欧美| 亚洲国产成人91porn| 成人在线视频一区二区| 精品国产一区二区三区久久影院 | 亚洲精品老司机| 韩国午夜理伦三级不卡影院| 欧美日韩一级大片网址| 国产精品对白交换视频| 国产一区二区中文字幕| 911精品产国品一二三产区| 亚洲欧美色一区| heyzo一本久久综合| 久久久久久黄色| 九九视频精品免费| 欧美一区二区三区免费| 亚洲二区在线视频| 欧美性猛片aaaaaaa做受| 中文字幕一区二区三区乱码在线| 国产在线视频一区二区| 欧美成人午夜电影| 日韩电影在线观看电影| 4438x亚洲最大成人网| 亚洲在线一区二区三区| 欧美艳星brazzers| 亚洲免费观看高清| 91福利社在线观看| 亚洲影视在线观看| 欧美午夜寂寞影院| 日韩精品一二三区| 欧美福利视频一区| 日本午夜一本久久久综合| 在线播放一区二区三区| 天堂影院一区二区| 日韩欧美一级在线播放| 久久国产尿小便嘘嘘尿| 精品国产123| 国产精品亚洲一区二区三区在线| 国产日韩一级二级三级| 国产精品99精品久久免费| 欧美激情中文字幕| 99国产精品国产精品毛片| 亚洲免费观看高清在线观看| 欧美色网站导航| 青草国产精品久久久久久| 26uuu亚洲综合色欧美| 欧美日韩一区二区三区四区五区| 午夜在线电影亚洲一区| 欧美一区二区精品久久911| 韩国三级中文字幕hd久久精品| 国产视频视频一区| 色嗨嗨av一区二区三区| 日日夜夜精品视频天天综合网| 精品国产一区a| 一本大道久久a久久综合婷婷 | 日韩欧美精品在线视频| 国产精品69毛片高清亚洲| 亚洲精品中文在线观看| 91精品国产入口在线| 成人午夜免费电影| 日韩激情一区二区| 亚洲国产精品二十页| 欧美蜜桃一区二区三区| 国产福利不卡视频| 亚洲在线视频网站| 欧美经典一区二区三区| 欧美性猛交xxxxxxxx| 国产在线视频一区二区三区| 亚洲免费在线观看视频| 欧美精品一区二区三区在线| 色8久久精品久久久久久蜜| 精品中文av资源站在线观看| 久久99蜜桃精品| 一区二区三区四区亚洲| 久久久蜜桃精品| 欧美丰满高潮xxxx喷水动漫| caoporn国产一区二区| 黄色小说综合网站| 亚洲成a人v欧美综合天堂下载 | 亚洲成av人**亚洲成av**| 国产精品三级av在线播放| 欧美久久一区二区| 色先锋aa成人| 国产精品一区二区在线播放 | 日韩欧美一区二区不卡| 在线视频国产一区| www.欧美亚洲| 国产专区欧美精品| 美女www一区二区| 午夜欧美一区二区三区在线播放| 欧美高清一级片在线观看| 欧美电影免费观看高清完整版 | 激情综合五月婷婷| 日韩影院在线观看| 亚洲电影你懂得| 亚洲伊人色欲综合网| 中文字幕亚洲欧美在线不卡| 久久―日本道色综合久久| 精品捆绑美女sm三区| 日韩一区二区三区电影| 欧美美女一区二区| 欧美日韩一卡二卡三卡 | 精品亚洲国内自在自线福利| 婷婷久久综合九色国产成人 | 久久激情五月激情| 日本欧美一区二区三区| 午夜精品福利一区二区三区av | 亚洲欧洲另类国产综合| 一区视频在线播放| 一区免费观看视频| 亚洲欧美日本在线| 一个色综合av| 日韩精品电影一区亚洲| 男男gaygay亚洲| 国产乱色国产精品免费视频| 国产乱子轮精品视频| 国内偷窥港台综合视频在线播放| 欧美在线一区二区三区| 欧美性大战xxxxx久久久| 91精品91久久久中77777| 欧美性猛交xxxx黑人交| 666欧美在线视频| 精品处破学生在线二十三| 精品日韩99亚洲| 国产精品色婷婷| 亚洲一区在线免费观看| 日本欧美韩国一区三区| 国产精品一色哟哟哟| 91污在线观看| 欧美一区二区在线不卡| 欧美精品一区二区久久婷婷 | 91久久线看在观草草青青| 欧美人狂配大交3d怪物一区| 欧美va在线播放| 亚洲欧美电影一区二区| 免费观看久久久4p| 成人免费的视频| 666欧美在线视频| 欧美国产一区二区| 亚洲成人综合网站| 国产一本一道久久香蕉| 在线观看中文字幕不卡| 欧美精品一区二区在线观看| 亚洲欧美一区二区三区国产精品| 爽好多水快深点欧美视频| 国产精品一区二区在线观看不卡| 在线免费不卡电影| 国产欧美一区二区精品忘忧草| 一区二区三区中文字幕在线观看| 激情综合亚洲精品| 欧美日韩一区二区三区四区五区| 久久精品这里都是精品| 日本在线不卡一区| 色综合婷婷久久|