|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
你说是sun公司对她研究的透还是微软?针对自己工具开发的.net性能上肯定会站上风的。xmlpackagefranzy;
importorg.w3c.dom.Element;
importoracle.xml.parser.v2.XMLElement;
importoracle.xml.parser.v2.XMLDocument;
//importcom.biztunnel.util.tools.ToolKit;
publicclassAgency
{
privateStringagencyID;
privateStringagencyOther;
privateStringa_dtype;
privateElementelement;
publicstaticfinalStringAGENCYCODE_OTHER="Other";
publicstaticfinalStringAGENCYCODE_COMMERCEONE="CommerceOne";
publicstaticfinalStringAGENCYCODE_ISO="ISO";
publicstaticfinalStringAGENCYCODE_EAN="EAN";
publicstaticfinalStringAGENCYCODE_ASSIGNEDBYSUPPLIER="AssignedBySupplier";
publicstaticfinalStringAGENCYCODE_ASSIGNEDBYBUYER="AssignedByBuyer";
publicstaticfinalStringAGENCYCODE_ANSI="ANSI";
publicstaticfinalStringAGENCYCODE_GBABA="GBABA";
privatestaticfinalStringAGENCY_ATTRIBUTE_A_DTYPE="%Agency-Dtypes;";
/**
*CreatesaAgencyElementaccordingtotheouterelement
*/
privatevoidinit()
{
this.element=newXMLElement("Agency");
agencyID=null;
agencyOther=null;
a_dtype=this.AGENCY_ATTRIBUTE_A_DTYPE;
}
publicAgency(ElementnewElement)
{
init();
//ElementnewElement=(Element)newElement1.getLastChild();
if(!newElement.getNodeName().equals("Agency"))
//if(!newElement1.getLastChild().getNodeName().equals("Agency"))
{
System.out.println("notit!!!");
}
//getattribute
this.setAgencyID(newElement.getAttribute("AgencyID"));
this.setAgencyOther(newElement.getAttribute("AgencyOther"));
this.agencyID=newElement.getAttribute("a-dtype");
}
/**
*CreateanemptyAgencyelementaccordingtothebuginfo.dtd
*/
publicAgency()
{
//initializetheemptynode
this.init();
}
/**
*convertthiselementtoW3cElementformat
*/
publicElementgetElement()
{
if(this.getAgencyID()!=null)
{
this.element.setAttribute("AgencyID",this.getAgencyID());
}
if(this.getAgencyOther()!=null)
{
this.element.setAttribute("AgencyOther",this.agencyOther);
}
if(this.getA_dtype()!=null)
{
this.element.setAttribute("a-dtype",this.a_dtype);
}
returnthis.element;
}
publicvoidsetAgencyID(StringnewAgencyID)
{
agencyID=newAgencyID;
}
publicStringgetAgencyID()
{
returnagencyID;
}
publicvoidsetAgencyOther(StringnewAgencyOther)
{
agencyOther=newAgencyOther;
}
publicStringgetAgencyOther()
{
returnagencyOther;
}
publicStringgetA_dtype()
{
returna_dtype;
}
publicvoidsetFixedA_dtype(booleanisSet)
{
if(isSet)
{
a_dtype=this.AGENCY_ATTRIBUTE_A_DTYPE;
}
else
{
a_dtype=null;
}
}
publicstaticvoidmain(String[]args)
{
try
{
//test1
Agencyelement=newAgency();
element.setFixedA_dtype(true);
element.setAgencyID(Agency.AGENCYCODE_ASSIGNEDBYBUYER);
element.setAgencyOther("other");
XMLDocumentdoc=newXMLDocument();
doc.appendChild(element.getElement());
System.out.println(ToolKit.getXmlString(doc));
//test2
Agencyelement1=newAgency(element.getElement());
System.out.println(element1.getA_dtype());
}catch(Exceptione)
{
e.printStackTrace();
}
}
}
有成绩来找我
j2EE和asp比较,其实也没什么比的,原因和我上面说那些比较差不了多少,也是稳定性,安全性,J2EE比asp高,速度上比不过asp,asp也是延续着它的拖拽控件的方法,提高速度。 |
|