001: /**
002: * $Id: TypeElementDescriptorImpl.java,v 1.6 2003/12/01 10:47:45 vv138407 Exp $
003: * Copyright 2002-2003 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.providers.simplewebservice.wsdl.impl;
014:
015: import com.sun.portal.providers.simplewebservice.wsdl.TypeElementDescriptor;
016:
017: /**
018: * This class represents an element defined within a complex type
019: *
020: */
021: public class TypeElementDescriptorImpl implements TypeElementDescriptor {
022: private String name = null;
023: private String type = null;
024: private String defaultValue = null;
025: private String targetNamespaceURI = null;
026: private boolean isRepeated = false;
027:
028: //The above field targetNamespaceURI is require in case of document-literal
029: //services
030: public TypeElementDescriptorImpl(String name, String type,
031: String defaultValue) {
032: this .name = name;
033: this .type = type;
034: this .defaultValue = defaultValue;
035: }
036:
037: public TypeElementDescriptorImpl(String name, String type,
038: String defaultValue, String targetNamespaceURI) {
039:
040: this (name, type, defaultValue);
041: this .targetNamespaceURI = targetNamespaceURI;
042:
043: }
044:
045: /**
046: * Get the name of this element.
047: *
048: * @return the element name.
049: */
050: public String getName() {
051: return name;
052: }
053:
054: /**
055: * Get the type of the element.
056: *
057: * @return the type of the element.
058: */
059: public String getType() {
060: return type;
061: }
062:
063: /**
064: * Get any default value of the element.
065: *
066: * @return any default value of the element.
067: */
068: public String getDefaultValue() {
069: return defaultValue;
070: }
071:
072: public void setIsRepeated(boolean isRepeated) {
073: this .isRepeated = isRepeated;
074: }
075:
076: public boolean isRepeated() {
077: return this .isRepeated;
078: }
079:
080: /**
081: * Get the String representation of this TypeElementDescriptor.
082: *
083: * @return the String representation of this TypeElementDescriptor.
084: */
085: public String toString() {
086: StringBuffer strBuf = new StringBuffer();
087:
088: strBuf.append("\nTypeElementDescriptor: name=" + name);
089:
090: if (type != null) {
091: strBuf.append("\ntype:" + type);
092: }
093:
094: if (defaultValue != null) {
095: strBuf.append("\ndefault value:" + defaultValue);
096: }
097:
098: return strBuf.toString();
099: }
100:
101: }
|