📄 menuitem.java
字号:
/*
* This class was automatically generated with
* <a href="http://castor.exolab.org">Castor 0.9.3.9+</a>, using an
* XML Schema.
* $Id: MenuItem.java,v 1.3 2007/10/17 06:00:51 forever Exp $
*/
package com.pegasus.framework.castor.menu;
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Enumeration;
import org.exolab.castor.xml.*;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.ContentHandler;
/**
*
*
* @version $Revision: 1.3 $ $Date: 2007/10/17 06:00:51 $
**/
public class MenuItem implements java.io.Serializable {
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
private java.lang.String _id;
private java.lang.String _caption;
private java.lang.String _icon1;
private java.lang.String _icon2;
private java.lang.String _url;
private java.lang.String _target;
private java.lang.String _description;
private java.util.ArrayList _menuItemList;
//----------------/
//- Constructors -/
//----------------/
public MenuItem() {
super();
_menuItemList = new ArrayList();
} //-- com.chiic.csc.sys.castor.menu.MenuItem()
//-----------/
//- Methods -/
//-----------/
/**
*
*
* @param vMenuItem
**/
public void addMenuItem(MenuItem vMenuItem)
throws java.lang.IndexOutOfBoundsException
{
_menuItemList.add(vMenuItem);
} //-- void addMenuItem(MenuItem)
/**
*
*
* @param index
* @param vMenuItem
**/
public void addMenuItem(int index, MenuItem vMenuItem)
throws java.lang.IndexOutOfBoundsException
{
_menuItemList.add(index, vMenuItem);
} //-- void addMenuItem(int, MenuItem)
/**
**/
public void clearMenuItem()
{
_menuItemList.clear();
} //-- void clearMenuItem()
/**
**/
public java.util.Enumeration enumerateMenuItem()
{
return new org.exolab.castor.util.IteratorEnumeration(_menuItemList.iterator());
} //-- java.util.Enumeration enumerateMenuItem()
/**
* Returns the value of field 'caption'.
*
* @return the value of field 'caption'.
**/
public java.lang.String getCaption()
{
return this._caption;
} //-- java.lang.String getCaption()
/**
* Returns the value of field 'description'.
*
* @return the value of field 'description'.
**/
public java.lang.String getDescription()
{
return this._description;
} //-- java.lang.String getDescription()
/**
* Returns the value of field 'icon1'.
*
* @return the value of field 'icon1'.
**/
public java.lang.String getIcon1()
{
return this._icon1;
} //-- java.lang.String getIcon1()
/**
* Returns the value of field 'icon2'.
*
* @return the value of field 'icon2'.
**/
public java.lang.String getIcon2()
{
return this._icon2;
} //-- java.lang.String getIcon2()
/**
* Returns the value of field 'id'.
*
* @return the value of field 'id'.
**/
public java.lang.String getId()
{
return this._id;
} //-- java.lang.String getId()
/**
*
*
* @param index
**/
public MenuItem getMenuItem(int index)
throws java.lang.IndexOutOfBoundsException
{
//-- check bounds for index
if ((index < 0) || (index > _menuItemList.size())) {
throw new IndexOutOfBoundsException();
}
return (MenuItem) _menuItemList.get(index);
} //-- MenuItem getMenuItem(int)
/**
**/
public MenuItem[] getMenuItem()
{
int size = _menuItemList.size();
MenuItem[] mArray = new MenuItem[size];
for (int index = 0; index < size; index++) {
mArray[index] = (MenuItem) _menuItemList.get(index);
}
return mArray;
} //-- MenuItem[] getMenuItem()
/**
**/
public int getMenuItemCount()
{
return _menuItemList.size();
} //-- int getMenuItemCount()
/**
* Returns the value of field 'target'.
*
* @return the value of field 'target'.
**/
public java.lang.String getTarget()
{
return this._target;
} //-- java.lang.String getTarget()
/**
* Returns the value of field 'url'.
*
* @return the value of field 'url'.
**/
public java.lang.String getUrl()
{
return this._url;
} //-- java.lang.String getUrl()
/**
**/
public boolean isValid()
{
try {
validate();
}
catch (org.exolab.castor.xml.ValidationException vex) {
return false;
}
return true;
} //-- boolean isValid()
/**
*
*
* @param out
**/
public void marshal(java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
{
Marshaller.marshal(this, out);
} //-- void marshal(java.io.Writer)
/**
*
*
* @param handler
**/
public void marshal(org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
{
Marshaller.marshal(this, handler);
} //-- void marshal(org.xml.sax.ContentHandler)
/**
*
*
* @param vMenuItem
**/
public boolean removeMenuItem(MenuItem vMenuItem)
{
boolean removed = _menuItemList.remove(vMenuItem);
return removed;
} //-- boolean removeMenuItem(MenuItem)
/**
* Sets the value of field 'caption'.
*
* @param caption the value of field 'caption'.
**/
public void setCaption(java.lang.String caption)
{
this._caption = caption;
} //-- void setCaption(java.lang.String)
/**
* Sets the value of field 'description'.
*
* @param description the value of field 'description'.
**/
public void setDescription(java.lang.String description)
{
this._description = description;
} //-- void setDescription(java.lang.String)
/**
* Sets the value of field 'icon1'.
*
* @param icon1 the value of field 'icon1'.
**/
public void setIcon1(java.lang.String icon1)
{
this._icon1 = icon1;
} //-- void setIcon1(java.lang.String)
/**
* Sets the value of field 'icon2'.
*
* @param icon2 the value of field 'icon2'.
**/
public void setIcon2(java.lang.String icon2)
{
this._icon2 = icon2;
} //-- void setIcon2(java.lang.String)
/**
* Sets the value of field 'id'.
*
* @param id the value of field 'id'.
**/
public void setId(java.lang.String id)
{
this._id = id;
} //-- void setId(java.lang.String)
/**
*
*
* @param index
* @param vMenuItem
**/
public void setMenuItem(int index, MenuItem vMenuItem)
throws java.lang.IndexOutOfBoundsException
{
//-- check bounds for index
if ((index < 0) || (index > _menuItemList.size())) {
throw new IndexOutOfBoundsException();
}
_menuItemList.set(index, vMenuItem);
} //-- void setMenuItem(int, MenuItem)
/**
*
*
* @param menuItemArray
**/
public void setMenuItem(MenuItem[] menuItemArray)
{
//-- copy array
_menuItemList.clear();
for (int i = 0; i < menuItemArray.length; i++) {
_menuItemList.add(menuItemArray[i]);
}
} //-- void setMenuItem(MenuItem)
/**
* Sets the value of field 'target'.
*
* @param target the value of field 'target'.
**/
public void setTarget(java.lang.String target)
{
this._target = target;
} //-- void setTarget(java.lang.String)
/**
* Sets the value of field 'url'.
*
* @param url the value of field 'url'.
**/
public void setUrl(java.lang.String url)
{
this._url = url;
} //-- void setUrl(java.lang.String)
/**
*
*
* @param reader
**/
public static MenuItem unmarshal(java.io.Reader reader)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
{
return (MenuItem) Unmarshaller.unmarshal(MenuItem.class, reader);
} //-- com.chiic.csc.sys.castor.menu.MenuItem unmarshal(java.io.Reader)
/**
**/
public void validate()
throws org.exolab.castor.xml.ValidationException
{
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
validator.validate(this);
} //-- void validate()
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -