⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 synccommand.java

📁 j2me sip客户端程序源码 提供了J2ME中SIP协议开发样例源码
💻 JAVA
字号:
/**
 * @(#)$RCSfile: SyncCommand.java,v $            $Revision: 1.2 $
 *
 * ====================================================================
 * Copyright 2001, Reaxion Corp.,
 * 11418 105th PL NE, Kirkland, WA, 98033, USA
 * All rights reserved.
 * ====================================================================
 *
 * The contents of this file are subject to the Mozilla Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code is the Tequila SyncML.
 *
 * The Initial Developer of the Original Code is Reaxion Corp.
 * All Rights Reserved.
 */
package com.reaxion.tequila.syncml;

import java.util.*;

import com.reaxion.tequila.syncml.xml.IXMLNode;

/**
 * Abstract class for SyncSyncCommand (SyncAdd, SyncDelete, SyncPut, SyncReplace), SyncAlert
 * <p>
 * <pre>
 * &lt;!ELEMENT ... (CmdID, Item)&gt;
 *
 *  &lt;CommandName&gt;
 *      &lt;CmdID&gt;CmdId (int)&lt;/CmdID&gt;
 *      ?&lt;Data&gt;Alert code (short)&lt;/Data&gt;
 *      &lt;Item&gt;
 *      &lt;Target&gt;
 *             &lt;LocURI&gt;target (XPath)&lt;/LocURI&gt;
 *             ?&lt;LocName&gt;name&lt;/LocName&gt;
 *          &lt;/Target&gt;
 *          ?&lt;Source&gt;
 *             &lt;LocURI&gt;target (XPath)&lt;/LocURI&gt;
 *             ?&lt;LocName&gt;name&lt;/LocName&gt;
 *          &lt;/Source&gt;
 *      ?&lt;Data&gt;
 *             data to Add/Put/Replace
 *        &lt;/Data&gt;
 *      &lt;/Item&gt;
 *  &lt;/CommandName&gt;
 * </pre>
 *
 * @version   $1.0$
 * @author    Oleg A. Oksyuk
 */
public abstract class SyncCommand extends SyncTargetOwner
{

    private SyncItem item;

    public SyncCommand(IXMLNode el)
    {
        super(el, new SyncTarget(el.getChild(SyncCommandNames.ITEM)
            .getChild(SyncCommandNames.TARGET)));
        item = new SyncItem(el.getChild(SyncCommandNames.ITEM));
    }

    public SyncCommand(String pTag, SyncCmdId pCmdId, SyncItem pItem, boolean isNoResp)
    {
        super(pTag, pCmdId, (SyncTarget) pItem.getTarget(), isNoResp);
        item = pItem;
    }


    public SyncItem getItem()
    {
        return item;
    }

    public Object getElData(int level)
    {
		StringBuffer res = new StringBuffer();
        res.append(getCmdId().toString(level+1));
        if (isNoResp())
        {
            res.append(SyncCommandNames.DEF.SYNC_NO_RESP.toString(level+1));
        }
        res.append(item.toString(level+1));
        return res;
    }
}

/* -----------------------------------------------------------------------------
 * Change log:
 * -----------------------------------------------------------------------------
 * $Log: SyncCommand.java,v $
 * Revision 1.2  2001/10/17 15:27:42  OlegO
 * changed comments for better javadoc
 *
 * Revision 1.1.1.1  2001/10/11 13:13:32  OlegO
 * no message
 *
 * Revision 1.2  2001/07/27 07:41:18  OlegO
 * no message
 *
 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -