📄 syncalert.java
字号:
/**
* @(#)$RCSfile: SyncAlert.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 com.reaxion.tequila.syncml.xml.IXMLNode;
/**
* <!ELEMENT Alert (CmdID, Data, Item, NoResp? - never exists for now)>
* <p>
* <pre>
* <Alert>
* <CmdID>CmdId (int)</CmdID>
* <Data>Alert code (short)</Data>
* <Item>
* <Target>
* <LocURI>target (DB Name)</LocURI>
* ?<LocName>name</LocName>
* </Target>
* ?<Source>
* <LocURI>target (DB Name)</LocURI>
* ?<LocName>name</LocName>
* </Source>
* </Item>
* </Alert>
* </pre>
*
* @version $1.0$
* @author Oleg A. Oksyuk
*/
public class SyncAlert extends SyncCommand
{
private SyncData data;
public SyncAlert(IXMLNode el)
{
super(el);
data = new SyncData(el.getChild(SyncCommandNames.DATA));
}
public SyncAlert(SyncCmdId pCmdId, SyncData pData, SyncItem pItem)
{
super(SyncCommandNames.ALERT, pCmdId, pItem, false);
data = pData;
}
public SyncAlert(short alertCode, SyncTarget pTarget)
{
super(SyncCommandNames.ALERT, SyncCommandNames.DEF.EMPTY_CMD_ID,
new SyncItem(null, pTarget, null), false);
data = new SyncData(""+alertCode, null);
}
public SyncData getData()
{
return data;
}
public short getAlertCode()
{
return Short.parseShort(data.getData());
}
public Object getElData(int level)
{
StringBuffer res = new StringBuffer();
res.append(getCmdId().toString(level+1));
if (data != null)
{
res.append(data.toString(level+1));
}
res.append(getItem().toString(level+1));
return res;
}
}
/* -----------------------------------------------------------------------------
* Change log:
* -----------------------------------------------------------------------------
* $Log: SyncAlert.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 + -