📄 header.java
字号:
/**
* This file is generated by BorlandXML.
*/
package com.prudsys.pdm.Adapters.PmmlVersion20;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
* The Header class represents the element "Header" with the content
* model defined as follows:
* <p>
* <!ELEMENT Header (Application?,Annotation*,Timestamp?)><br>
*/
public class Header extends com.borland.xml.toolkit.XmlObject
{
/** xml tag name of this element. */
public static String _tagName = "Header";
/** Defines a copyright attribute */
public com.borland.xml.toolkit.Attribute copyright = new com.borland.xml.toolkit.Attribute("copyright", "CDATA", "REQUIRED", "");
/** Defines a description attribute */
public com.borland.xml.toolkit.Attribute description = new com.borland.xml.toolkit.Attribute("description", "CDATA", "IMPLIED", "");
/** Defines a Application object */
protected Application _objApplication;
/** Defines a list of Annotation objects. */
protected ArrayList _objAnnotation = new ArrayList();
/** Defines a Timestamp object */
protected Timestamp _objTimestamp;
/**
* Creates an empty Header object
*/
public Header()
{
super();
}
/**
* Gets the value of "copyright" attribute.
*/
public String getCopyright()
{
return copyright.getValue();
}
/**
* Replaces the existing attribute value with a new value.
* @param value New value.
*/
public void setCopyright(String value_)
{
copyright.setValue(value_ );
}
/**
* Gets the value of "description" attribute.
*/
public String getDescription()
{
return description.getValue();
}
/**
* Replaces the existing attribute value with a new value.
* @param value New value.
*/
public void setDescription(String value_)
{
description.setValue(value_ );
}
/**
* Gets Application object.
*/
public Application getApplication()
{
return _objApplication;
}
/**
* Replaces the existing Application object with a new object.
* If you pass in a null value to this method, the Application object is
* cleared and will not be marshaled.
* @param obj A new object.
*/
public void setApplication(Application obj)
{
this._objApplication = obj;
if( obj == null )
return;
obj._setParent(this);
}
/**
* Returns an array of Annotation objects. The length of the returned
* array is zero if the list of Annotation object is empty.
*/
public Annotation[] getAnnotation()
{
return (Annotation[])_objAnnotation.toArray(new Annotation[0]);
}
/**
* Replaces all existing Annotation objects with a new array of
* Annotation objects.
* @param objArray an array of Annotation objects.
*/
public void setAnnotation(Annotation[] objArray)
{
if( objArray == null || objArray.length == 0 )
this._objAnnotation.clear();
else
{
this._objAnnotation = new ArrayList(Arrays.asList(objArray));
for( int i=0; i<objArray.length; i++ )
{
if( objArray[i] != null )
objArray[i]._setParent(this);
}
}
}
/**
* Gets the Annotation object at the specified index.
* @param index index of the returned object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public Annotation getAnnotation(int index)
{
return (Annotation)_objAnnotation.get(index);
}
/**
* Replaces an existing Annotation object at the specified index with
* a new Annotation object.
* @param index index of replaced object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public void setAnnotation(int index, Annotation obj)
{
if( obj == null )
removeAnnotation(index);
else
{
_objAnnotation.set(index, obj);
obj._setParent(this);
}
}
/**
* Returns the number of Annotation objects in the list.
*/
public int getAnnotationCount()
{
return _objAnnotation.size();
}
/**
* Returns <code>true</code> if there is no Annotation object in the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean isNoAnnotation()
{
return _objAnnotation.size() == 0;
}
/**
* Returns a read-only list of Annotation objects.
*/
public List getAnnotationList()
{
return Collections.unmodifiableList(_objAnnotation);
}
/**
* Adds a new Annotation object at the end of the list.
* @return <code>true</code> if the new object is added to the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean addAnnotation(Annotation obj)
{
if( obj==null )
return false;
obj._setParent(this);
return _objAnnotation.add(obj);
}
/**
* Adds a list of new Annotation objects at the end of the list.
* @return <code>true</code> if the list was changed; otherwise, the method
* returns <code>false</code>.
*/
public boolean addAnnotation(Collection coAnnotation)
{
if( coAnnotation==null )
return false;
java.util.Iterator it = coAnnotation.iterator();
while( it.hasNext() )
{
Object obj = it.next();
if( obj != null && obj instanceof com.borland.xml.toolkit.XmlObject )
((com.borland.xml.toolkit.XmlObject)obj)._setParent(this);
}
return _objAnnotation.addAll(coAnnotation);
}
/**
* Removes an existing Annotation object at the specified index.
* @return The removed object.
*/
public Annotation removeAnnotation(int index)
{
return (Annotation)_objAnnotation.remove(index);
}
/**
* Removes the specified Annotation object.
* @return <code>true</code> if this list contains the object; otherwise,
* the method returns <code>false</code>.
*/
public boolean removeAnnotation(Annotation obj)
{
return _objAnnotation.remove(obj);
}
/**
* Clears all Annotation objects from the list.
*/
public void clearAnnotationList()
{
_objAnnotation.clear();
}
/**
* Gets the text content of Timestamp object.
*/
public String getTimestampText()
{
return _objTimestamp==null ? null : _objTimestamp.getText();
}
/**
* Replaces the existing text of Timestamp object with a new text.
* If you pass in a null value to this method, the Timestamp object is
* cleared and will not be marshaled.
* @param text New text.
*/
public void setTimestampText(String text)
{
if( text == null )
{
this._objTimestamp = null;
return;
}
if( this._objTimestamp == null )
this._objTimestamp = new Timestamp();
this._objTimestamp.setText(text);
this._objTimestamp._setParent(this);
}
/**
* Gets Timestamp object.
*/
public Timestamp getTimestamp()
{
return _objTimestamp;
}
/**
* Replaces the existing Timestamp object with a new object.
* If you pass in a null value to this method, the Timestamp object is
* cleared and will not be marshaled.
* @param obj New object.
*/
public void setTimestamp(Timestamp obj)
{
this._objTimestamp = obj;
if( obj == null )
return;
obj._setParent(this);
}
/**
* 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 "copyright" attribute */
elem.addAttribute(copyright.marshal());
/** Marshals "description" attribute */
elem.addAttribute(description.marshal());
/** Marshals a Application object to an element */
if( _objApplication != null )
elem.addContent(_objApplication.marshal());
/** Marshals a list of Annotation objects to elements */
Iterator it1 = _objAnnotation.iterator();
while( it1.hasNext() )
{
Annotation obj = (Annotation)it1.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a Timestamp object to an element */
if( _objTimestamp != null )
elem.addContent(_objTimestamp.marshal());
return elem;
}
/**
* Unmarshals the specified "Header" element back to a Header object.
*/
public static Header unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
Header __objHeader = new Header();
if( __objHeader != null ) //found the element?
{
/** Unmarshals "copyright" attribute */
__objHeader.copyright.setValue(elem.getAttribute("copyright"));
/** Unmarshals "description" attribute */
__objHeader.description.setValue(elem.getAttribute("description"));
}
/** Unmarshals an element back to a Application object */
__objHeader.setApplication(Application.unmarshal(elem.getChild(Application._tagName)));
/** Unmarshals a list of "<<_tagName_>>" elements back to Annotation objects. */
Iterator it1 = elem.getChildren(Annotation._tagName).iterator();
while( it1.hasNext() )
__objHeader.addAnnotation(Annotation.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
/** Unmarshals an element back to a Timestamp object */
__objHeader.setTimestamp(Timestamp.unmarshal(elem.getChild(Timestamp._tagName)));
return __objHeader;
}
/**
* 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();
/** Application is optional */
if( _objApplication != null )
{
errors.add(_objApplication.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
/** Annotation is zero or more */
Iterator it1 = _objAnnotation.iterator();
while( it1.hasNext() )
{
Annotation obj = (Annotation)it1.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
/** Timestamp is optional */
if( _objTimestamp != null )
{
errors.add(_objTimestamp.validate(firstError));
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.
*/
public java.util.List _getChildren()
{
java.util.List children = new java.util.ArrayList();
/** adds _objApplication */
if( _objApplication != null )
children.add(_objApplication);
/** adds _objAnnotation */
if( _objAnnotation != null && _objAnnotation.size() > 0 )
children.add(_objAnnotation);
/** adds _objTimestamp */
if( _objTimestamp != null )
children.add(_objTimestamp);
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 + -