001: /* XMLAttribute.java NanoXML/Java
002: *
003: * $Revision: 1.17 $
004: * $Date: 2005/01/05 17:20:04 $
005: * $Name: $
006: *
007: * This file is part of NanoXML 2 for Java.
008: * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved.
009: *
010: * This software is provided 'as-is', without any express or implied warranty.
011: * In no event will the authors be held liable for any damages arising from the
012: * use of this software.
013: *
014: * Permission is granted to anyone to use this software for any purpose,
015: * including commercial applications, and to alter it and redistribute it
016: * freely, subject to the following restrictions:
017: *
018: * 1. The origin of this software must not be misrepresented; you must not
019: * claim that you wrote the original software. If you use this software in
020: * a product, an acknowledgment in the product documentation would be
021: * appreciated but is not required.
022: *
023: * 2. Altered source versions must be plainly marked as such, and must not be
024: * misrepresented as being the original software.
025: *
026: * 3. This notice may not be removed or altered from any source distribution.
027: */
028:
029: package net.n3.nanoxml;
030:
031: /**
032: * An attribute in an XML element. This is an internal class.
033: *
034: * @see net.n3.nanoxml.XMLElement
035: *
036: * @author Marc De Scheemaecker
037: * @version $Name: $, $Revision: 1.17 $
038: */
039: class XMLAttribute {
040:
041: /**
042: * The full name of the attribute.
043: */
044: private String fullName;
045:
046: /**
047: * The short name of the attribute.
048: */
049: private String name;
050:
051: /**
052: * The namespace URI of the attribute.
053: */
054: private String namespace;
055:
056: /**
057: * The value of the attribute.
058: */
059: private String value;
060:
061: /**
062: * The type of the attribute.
063: */
064: private String type;
065:
066: /**
067: * Creates a new attribute.
068: *
069: * @param fullName the non-null full name
070: * @param name the non-null short name
071: * @param namespace the namespace URI, which may be null
072: * @param value the value of the attribute
073: * @param type the type of the attribute
074: */
075: XMLAttribute(String fullName, String name, String namespace,
076: String value, String type) {
077: this .fullName = fullName;
078: this .name = name;
079: this .namespace = namespace;
080: this .value = value;
081: this .type = type;
082: }
083:
084: /**
085: * Returns the full name of the attribute.
086: */
087: String getFullName() {
088: return this .fullName;
089: }
090:
091: /**
092: * Returns the short name of the attribute.
093: */
094: String getName() {
095: return this .name;
096: }
097:
098: /**
099: * Returns the namespace of the attribute.
100: */
101: String getNamespace() {
102: return this .namespace;
103: }
104:
105: /**
106: * Returns the value of the attribute.
107: */
108: String getValue() {
109: return this .value;
110: }
111:
112: /**
113: * Sets the value of the attribute.
114: *
115: * @param value the new value.
116: */
117: void setValue(String value) {
118: this .value = value;
119: }
120:
121: /**
122: * Returns the type of the attribute.
123: *
124: * @param type the new type.
125: */
126: String getType() {
127: return this.type;
128: }
129:
130: }
|