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

📄 datasource.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
字号:
/**
 * This file is generated by BorlandXML.
 */

package com.prudsys.pdm.Adapters.ServiceAPI.DataSource;


/**
 * The DataSource class represents the element "DataSource" with the content
 * model defined as follows:
 * <p>
 * &lt;!ELEMENT DataSource (DatabaseSource|FileSource)&gt;<br>
 */
public class DataSource extends com.borland.xml.toolkit.XmlObject 
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 4220156629560012152L;
	/** xml tag name of this element. */
	public static String _tagName = "DataSource";
	/** Defines a name attribute */
	public com.borland.xml.toolkit.Attribute name = new com.borland.xml.toolkit.Attribute("name", "CDATA", "REQUIRED", "");
	/** Defines a DatabaseSource object */
	protected DatabaseSource _objDatabaseSource;
	/** Defines a FileSource object */
	protected FileSource _objFileSource;

	/**
	 * Creates an empty DataSource object
	 */
	public DataSource()
	{
		super();
	}

	/**
	 * Gets the value of "name" attribute.
	 */
	public String getName()
	{
		return name.getValue();
	}

	/**
	 * Replaces the existing attribute value with a new value.
	 * @param value	New value.
	 */
	public void setName(String value_)
	{
		name.setValue(value_ );
	}

	/**
	 * Gets DatabaseSource object.
	 */
	public DatabaseSource getDatabaseSource()
	{
		return _objDatabaseSource;
	}

	/**
	 * Replaces the existing DatabaseSource object with a new object.
	 * If you pass in a null value to this method, the DatabaseSource object is
	 * cleared and will not be marshaled.
	 * @param obj	A new object.
	 */
	public void setDatabaseSource(DatabaseSource obj)
	{
		this._objDatabaseSource = obj;
		if( obj == null )
            return;

        obj._setParent(this);
		_objFileSource = null;
	}
	/**
	 * Gets FileSource object.
	 */
	public FileSource getFileSource()
	{
		return _objFileSource;
	}

	/**
	 * Replaces the existing FileSource object with a new object.
	 * If you pass in a null value to this method, the FileSource object is
	 * cleared and will not be marshaled.
	 * @param obj	A new object.
	 */
	public void setFileSource(FileSource obj)
	{
		this._objFileSource = obj;
		if( obj == null )
            return;

        obj._setParent(this);
		_objDatabaseSource = null;
	}

	/**
	 * Marshals this object to an element.
	 */
	public com.borland.xml.toolkit.Element marshal()
	{
		com.borland.xml.toolkit.Element elem = new com.borland.xml.toolkit.Element(get_TagName());
		/** Marshals "name" attribute */
		elem.addAttribute(name.marshal());
		/** Marshals a DatabaseSource object to an element */
		if( _objDatabaseSource != null )
			elem.addContent(_objDatabaseSource.marshal());
		/** Marshals a FileSource object to an element */
		if( _objFileSource != null )
			elem.addContent(_objFileSource.marshal());

		return elem;
	}

	/**
	 * Unmarshals the specified "DataSource" element back to a DataSource object.
	 */
	public static DataSource unmarshal(com.borland.xml.toolkit.Element elem)
	{
		if( elem == null )
			return null;

		DataSource __objDataSource = new DataSource();
		if( __objDataSource != null ) //found the element?
		{
			/** Unmarshals "name" attribute */
			__objDataSource.name.setValue(elem.getAttribute("name"));
		}
		/** Unmarshals an element back to a DatabaseSource object */
		__objDataSource.setDatabaseSource(DatabaseSource.unmarshal(elem.getChild(DatabaseSource._tagName)));
		/** Unmarshals an element back to a FileSource object */
		__objDataSource.setFileSource(FileSource.unmarshal(elem.getChild(FileSource._tagName)));

		return __objDataSource;
	}

	/**
	 * Validates this object. If you pass <code>true</code> to this method, it
	 * checks for the first error and stops. On the other hand, if you pass
	 * <code>false</code> to this method, it collects all the errors by
	 * visiting every available elements.
	 * @param firstError	<code>true</code> to exit this method when the first error
	 * is found; <code>false</code> to collect all errors.
	 * @return com.borland.xml.toolkit.ErrorList	A list that contains one or more errors.
	 * @see com.borland.xml.toolkit.XmlObject#validate()
	 * @see com.borland.xml.toolkit.XmlObject#isValid()
	 * @see com.borland.xml.toolkit.ErrorList
	 */
	public com.borland.xml.toolkit.ErrorList validate(boolean firstError)
	{
		com.borland.xml.toolkit.ErrorList errors = new com.borland.xml.toolkit.ErrorList();

		/** "or" block */
		if( _objDatabaseSource != null )
		{
			/** DatabaseSource is mandatory */
			if( _objDatabaseSource != null )
				errors.add(_objDatabaseSource.validate(firstError));
			else
				errors.add(new com.borland.xml.toolkit.ElementError(this, DatabaseSource.class));
			if( firstError && errors.size() > 0 )
				return errors;
		}
		if( _objFileSource != null )
		{
			/** FileSource is mandatory */
			if( _objFileSource != null )
				errors.add(_objFileSource.validate(firstError));
			else
				errors.add(new com.borland.xml.toolkit.ElementError(this, FileSource.class));
			if( firstError && errors.size() > 0 )
				return errors;
		}
		if( !(_objDatabaseSource != null) && !(_objFileSource != null) )   /** missing one or more elements? */
		{
			com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
			errors1.add(new com.borland.xml.toolkit.ElementError(this, DatabaseSource.class));
			errors1.add(new com.borland.xml.toolkit.ElementError(this, FileSource.class));
			errors.add(errors1);
					if( firstError && errors.size() > 0 )
						return errors;
		}

		return errors.size()==0 ? null : errors;
	}

	/**
	 * Returns a list containing all child elements. Each element in the list is a subclass
	 * of XmlObject.
	 */
	@SuppressWarnings("unchecked")
	public java.util.List _getChildren()
	{
		java.util.List children = new java.util.ArrayList();
		/** adds _objDatabaseSource */
		if( _objDatabaseSource != null )
			children.add(_objDatabaseSource);
		/** adds _objFileSource */
		if( _objFileSource != null )
			children.add(_objFileSource);
		return children;
	}


	/**
	 * Gets the tag name of this element.
	 */
	public String get_TagName()
	{
		return _tagName;
	}
}

⌨️ 快捷键说明

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