xmlattrimpl.java

来自「j2me sip客户端程序源码 提供了J2ME中SIP协议开发样例源码」· Java 代码 · 共 103 行

JAVA
103
字号
/**
 * @(#)$RCSfile: XmlAttrImpl.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.xml.node;

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

import com.reaxion.tequila.syncml.xml.*;
import com.reaxion.tequila.syncml.util.*;

/**
 * IXmlAttr implementation for Jaxp xml parser
 *
 * @version   $1.0$
 * @author    Oleg A. Oksyuk
 */
public class XmlAttrImpl implements IXMLAttr
{

    private IXMLNode parent;
    private String name;
    private String value;

    public XmlAttrImpl(IXMLNode aParentNode, String aName, String aValue)
    {
        parent = aParentNode;
        name = aName;
        value = aValue;
    }

    public String getName()
    {
        return name;
    }

    public void add(IXMLNodeAttr node)
    {
        throw new XMLDocStructureException("Can not add to Attribute");
    }
    public void replace(String value)
    {
        parent.replaceAttribute(name, value);
    }
    public void delete()
    {
        parent.removeAttribute(name);
        parent = null;
    }

    public boolean isAttribute()
    {
        return true;
    }

    public String getValue()
    {
        return value;
    }

    public String toString()
    {
        return "?"+getName()+"=\'"+getValue()+"\'";
    }
}

/* -----------------------------------------------------------------------------
 * Change log:
 * -----------------------------------------------------------------------------
 * $Log: XmlAttrImpl.java,v $
 * Revision 1.2  2001/10/17 15:27:43  OlegO
 * changed comments for better javadoc
 *
 * Revision 1.1.1.1  2001/10/11 13:13:32  OlegO
 * no message
 *
 * Revision 1.1  2001/07/24 13:08:19  OlegO
 * no message
 *
 */

⌨️ 快捷键说明

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