X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fglobal%2FSurfaceAreaQuery.java;h=149b30dd173e88fb7946e4b21eeb629bc55a7e25;hp=5eb14d4a4521d1c701c05b4efb515b03b0084671;hb=8cf5da75ce5bf66f1ef5a495a41fdcc0a51f7138;hpb=a29c47e01d9689fad735bbeccfaef67676a425d1 diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java index 5eb14d4a45..149b30dd17 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java @@ -23,16 +23,13 @@ import java.util.Stack; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.xmlbeans.XmlNormalizedString; import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlString; import org.tianocore.BuildOptionsDocument; -import org.tianocore.DataIdDocument; +import org.tianocore.CNameType; import org.tianocore.ExternsDocument; import org.tianocore.FileNameConvention; -import org.tianocore.FvAttributeDocument; import org.tianocore.FvImagesDocument; -import org.tianocore.FvOptionDocument; import org.tianocore.GuidDeclarationsDocument; import org.tianocore.GuidsDocument; import org.tianocore.LibrariesDocument; @@ -48,21 +45,25 @@ import org.tianocore.OptionDocument; import org.tianocore.PPIsDocument; import org.tianocore.PackageDependenciesDocument; import org.tianocore.PackageHeadersDocument; +import org.tianocore.PcdCodedDocument; import org.tianocore.PlatformDefinitionsDocument; +import org.tianocore.PlatformHeaderDocument; import org.tianocore.PpiDeclarationsDocument; import org.tianocore.ProtocolDeclarationsDocument; +import org.tianocore.Sentence; import org.tianocore.SpdHeaderDocument; -import org.tianocore.SupportedArchitectures; +import org.tianocore.UserExtensionsDocument; import org.tianocore.FilenameDocument.Filename; import org.tianocore.MsaHeaderDocument.MsaHeader; import org.tianocore.ProtocolsDocument.Protocols.Protocol; import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify; -import org.tianocore.PlatformHeaderDocument; import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.PackageIdentification; import org.tianocore.build.id.PlatformIdentification; import org.tianocore.build.toolchain.ToolChainInfo; +import org.tianocore.logger.EdkLog; +import org.w3c.dom.Node; /** * SurfaceAreaQuery class is used to query Surface Area information from msa, @@ -265,12 +266,7 @@ public class SurfaceAreaQuery { String[] xPath; Object[] returns; - if (arch == null || arch.equals("")) { - xPath = new String[] { "/Filename" }; - } else { - xPath = new String[] { "/Filename[not(@SupArchList) or @SupArchList='" - + arch + "']" }; - } + xPath = new String[] { "/Filename" }; returns = get("SourceFiles", xPath); @@ -279,10 +275,18 @@ public class SurfaceAreaQuery { } Filename[] sourceFileNames = (Filename[]) returns; - String[][] outputString = new String[sourceFileNames.length][2]; + List outputList = new ArrayList(); for (int i = 0; i < sourceFileNames.length; i++) { - outputString[i][0] = sourceFileNames[i].getToolCode(); - outputString[i][1] = sourceFileNames[i].getStringValue(); + List archList = sourceFileNames[i].getSupArchList(); + if (arch == null || arch.equalsIgnoreCase("") || archList == null || contains(archList, arch)) { + outputList.add(new String[] {sourceFileNames[i].getToolCode(),sourceFileNames[i].getStringValue()}); + } + } + + String[][] outputString = new String[outputList.size()][2]; + for (int index = 0; index < outputList.size(); index++) { + outputString[index][0] = outputList.get(index)[0]; + outputString[index][1] = outputList.get(index)[1]; } return outputString; } @@ -393,7 +397,6 @@ public class SurfaceAreaQuery { String toolchainFamily = null; List archList = null; String cmd = null; - String targetName = null; String optionName = null; Object[] returns = get(from, xPath); @@ -438,19 +441,16 @@ public class SurfaceAreaQuery { } archList = new ArrayList(); - List archEnumList = option.getSupArchList(); + List archEnumList = option.getSupArchList(); if (archEnumList == null) { archList.add(null); } else { - archList.addAll(archEnumList); - /* + //archList.addAll(archEnumList); Iterator it = archEnumList.iterator(); while (it.hasNext()) { - System.out.println(it.next().getClass().getName()); - SupportedArchitectures.Enum archType = it.next(); - archList.add(archType.toString()); + String archType = (String)it.next(); + archList.add(archType); } - */ } cmd = option.getToolCode(); @@ -554,26 +554,37 @@ public class SurfaceAreaQuery { String packageGuid = null; String packageVersion = null; - if (arch == null || arch.equals("")) { - xPath = new String[] { "/Package" }; - } else { - xPath = new String[] { "/Package[not(@SupArchList) or @SupArchList='" - + arch + "']" }; - } - + + xPath = new String[] { "/Package" }; + Object[] returns = get("PackageDependencies", xPath); if (returns == null) { return new PackageIdentification[0]; } - PackageIdentification[] packageIdList = new PackageIdentification[returns.length]; + + // + // Get packageIdentification + // + List packageIdList = new ArrayList(); for (int i = 0; i < returns.length; i++) { PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i]; - packageGuid = item.getPackageGuid(); - packageVersion = item.getPackageVersion(); - packageIdList[i] = (new PackageIdentification(null, packageGuid, + List archList = item.getSupArchList(); + if (arch == null || archList == null || contains(archList, arch)) { + packageGuid = item.getPackageGuid(); + packageVersion = item.getPackageVersion(); + packageIdList.add(new PackageIdentification(null, packageGuid, packageVersion)); + } } - return packageIdList; + + // + // transfer packageIdentification list to array. + // + PackageIdentification[] packageIdArray = new PackageIdentification[packageIdList.size()]; + for (int i = 0; i < packageIdList.size(); i++) { + packageIdArray[i] = new PackageIdentification(null, packageIdList.get(i).getGuid(),packageIdList.get(i).getVersion()); + } + return packageIdArray; } /** @@ -586,9 +597,8 @@ public class SurfaceAreaQuery { * xpath * @returns null if nothing is there */ - public static String[] getLibraryClasses(String usage) { + public static String[] getLibraryClasses(String usage, String arch) { String[] xPath; - if (usage == null || usage.equals("")) { xPath = new String[] { "/LibraryClass" }; } else { @@ -601,11 +611,19 @@ public class SurfaceAreaQuery { } LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns; - String[] libraryClassName = new String[libraryClassList.length]; + List libraryClassName = new ArrayList(); for (int i = 0; i < libraryClassList.length; i++) { - libraryClassName[i] = libraryClassList[i].getKeyword(); + List archList = libraryClassList[i].getSupArchList(); + + if (arch == null || contains(archList, arch)) { + libraryClassName.add(libraryClassList[i].getKeyword()); + } } - return libraryClassName; + String[] libraryArray = new String[libraryClassName.size()]; + for (int i = 0; i < libraryClassName.size(); i++) { + libraryArray[i] = libraryClassName.get(i); + } + return libraryArray; } /** @@ -624,8 +642,7 @@ public class SurfaceAreaQuery { String[] entryPoints = new String[returns.length]; for (int i = 0; i < returns.length; ++i) { - entryPoints[i] = ((XmlNormalizedString) returns[i]) - .getStringValue(); + entryPoints[i] = ((CNameType) returns[i]).getStringValue(); } return entryPoints; @@ -651,7 +668,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - archXpath = "/Protocol[@SupArchList='" + arch + "']"; + archXpath = "/Protocol"; if (usage != null && !usage.equals("")) { usageXpath = "/Protocol[@Usage='" + usage + "']"; xPath = new String[] { usageXpath, archXpath }; @@ -689,18 +706,26 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - xPath = new String[] { "/Protocol[@SupArchList='" + arch + "']" }; + xPath = new String[] { "/Protocol" }; } Object[] returns = get("Protocols", xPath); if (returns == null) { return new String[0]; } - Protocol[] protocolList = (Protocol[]) returns; + Protocol[] returnlList = (Protocol[]) returns; - String[] protocolArray = new String[returns.length]; + List protocolList = new ArrayList(); + for (int i = 0; i < returns.length; i++) { - protocolArray[i] = protocolList[i].getProtocolCName(); + List archList = returnlList[i].getSupArchList(); + if (archList == null || contains(archList, arch)){ + protocolList.add(returnlList[i].getProtocolCName()); + } + } + String[] protocolArray = new String[protocolList.size()]; + for (int i = 0; i < protocolList.size(); i++) { + protocolArray[i] = protocolList.get(i); } return protocolArray; } @@ -720,8 +745,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - xPath = new String[] { "/ProtocolNotify[@SupArchList='" + arch - + "']" }; + xPath = new String[] { "/ProtocolNotify" }; } Object[] returns = get("Protocols", xPath); @@ -729,12 +753,20 @@ public class SurfaceAreaQuery { return new String[0]; } - String[] protocolNotifyList = new String[returns.length]; + List protocolNotifyList = new ArrayList(); + for (int i = 0; i < returns.length; i++) { - protocolNotifyList[i] = ((ProtocolNotify) returns[i]).getProtocolNotifyCName(); + List archList = ((ProtocolNotify) returns[i]).getSupArchList(); + if (archList == null || contains(archList, arch)){ + protocolNotifyList.add(((ProtocolNotify) returns[i]).getProtocolNotifyCName()); + } + } - - return protocolNotifyList; + String[] protocolNotifyArray = new String[protocolNotifyList.size()]; + for (int i = 0; i < protocolNotifyList.size(); i++) { + protocolNotifyArray[i] = protocolNotifyList.get(i); + } + return protocolNotifyArray; } /** @@ -755,7 +787,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - archXpath = "/ProtocolNotify[@SupArchList='" + arch + "']"; + archXpath = "/ProtocolNotify"; if (usage != null && !usage.equals("")) { usageXpath = "/ProtocolNotify[@Usage='" + arch + "']"; xPath = new String[] { archXpath, usageXpath }; @@ -790,7 +822,7 @@ public class SurfaceAreaQuery { Object[] returns = get("Externs", xPath); if (returns != null && returns.length > 0) { String[] stringArray = new String[returns.length]; - XmlNormalizedString[] doc = (XmlNormalizedString[]) returns; + CNameType[] doc = (CNameType[]) returns; for (int i = 0; i < returns.length; ++i) { stringArray[i] = doc[i].getStringValue(); @@ -834,7 +866,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - xPath = new String[] { "/PpiNotify[@SupArchList='" + arch + "']" }; + xPath = new String[] { "/PpiNotify" }; } Object[] returns = get("PPIs", xPath); @@ -842,12 +874,21 @@ public class SurfaceAreaQuery { return new String[0]; } - String[] ppiNotifyList = new String[returns.length]; + + List ppiNotifyList = new ArrayList(); for (int i = 0; i < returns.length; i++) { - ppiNotifyList[i] = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName(); + List archList = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getSupArchList(); + if (archList == null || contains(archList, arch)){ + ppiNotifyList.add(((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName()); + } + + } + String[] ppiNotifyArray = new String[ppiNotifyList.size()]; + for (int i = 0; i < ppiNotifyList.size(); i++) { + ppiNotifyArray[i] = ppiNotifyList.get(i); } - return ppiNotifyList; + return ppiNotifyArray; } /** @@ -869,7 +910,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - archXpath = "/PpiNotify[@SupArchList='" + arch + "']"; + archXpath = "/PpiNotify"; if (usage != null && !usage.equals("")) { usageXpath = "/PpiNotify[@Usage='" + arch + "']"; xPath = new String[] { archXpath, usageXpath }; @@ -906,7 +947,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - xPath = new String[] { "/Ppi[@SupArchList='" + arch + "']" }; + xPath = new String[] { "/Ppi" }; } Object[] returns = get("PPIs", xPath); @@ -914,11 +955,19 @@ public class SurfaceAreaQuery { return new String[0]; } - String[] ppiList = new String[returns.length]; + List ppiList = new ArrayList(); for (int i = 0; i < returns.length; i++) { - ppiList[i] = ((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName(); + List archList = ((PPIsDocument.PPIs.Ppi) returns[i]).getSupArchList(); + if (archList == null || contains(archList, arch)){ + ppiList.add(((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName()); + } + } - return ppiList; + String[] ppiArray = new String[ppiList.size()]; + for (int i = 0; i < ppiList.size(); i++) { + ppiArray[i] = ppiList.get(i); + } + return ppiArray; } /** @@ -940,7 +989,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - archXpath = "/Ppi[@SupArchList='" + arch + "']"; + archXpath = "/Ppi"; if (usage != null && !usage.equals("")) { usageXpath = "/Ppi[@Usage='" + arch + "']"; xPath = new String[] { archXpath, usageXpath }; @@ -975,20 +1024,29 @@ public class SurfaceAreaQuery { String[] xPath; if (arch == null || arch.equals("")) { - xPath = new String[] { "/GuidName" }; + xPath = new String[] { "/GuidCNames" }; } else { - xPath = new String[] { "/GuidName[@SupArchList='" + arch + "']" }; + xPath = new String[] { "/GuidCNames" }; } Object[] returns = get("Guids", xPath); if (returns == null) { return new String[0]; } - String[] guidList = new String[returns.length]; + + List guidList = new ArrayList(); for (int i = 0; i < returns.length; i++) { - guidList[i] = ((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName(); + List archList = ((GuidsDocument.Guids.GuidCNames) returns[i]).getSupArchList(); + if (archList == null || contains(archList, arch)){ + guidList.add(((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName()); + } + } - return guidList; + String[] guidArray = new String[guidList.size()]; + for (int i = 0; i < guidList.size(); i++) { + guidArray[i] = guidList.get(i); + } + return guidArray; } @@ -1009,7 +1067,7 @@ public class SurfaceAreaQuery { if (arch == null || arch.equals("")) { return new String[0]; } else { - archXpath = "/GuidEntry[@SupArchList='" + arch + "']"; + archXpath = "/GuidEntry"; if (usage != null && !usage.equals("")) { usageXpath = "/GuidEntry[@Usage='" + arch + "']"; xPath = new String[] { archXpath, usageXpath }; @@ -1053,6 +1111,11 @@ public class SurfaceAreaQuery { if (arch == null || arch.equalsIgnoreCase("")) { xPath = new String[] { "/Instance" }; } else { + // + // Since Schema don't have SupArchList now, so the follow Xpath is + // equal to "/Instance" and [not(@SupArchList) or @SupArchList= arch] + // don't have effect. + // xPath = new String[] { "/Instance[not(@SupArchList) or @SupArchList='" + arch + "']" }; } @@ -1096,7 +1159,7 @@ public class SurfaceAreaQuery { String[] strings = new String[returns.length]; for (int i = 0; i < returns.length; ++i) { // TBD - // strings[i] = ((CName) returns[i]).getStringValue(); + strings[i] = ((CNameType) returns[i]).getStringValue(); } return strings; @@ -1113,8 +1176,8 @@ public class SurfaceAreaQuery { Object[] returns = get("Externs", xPath); if (returns != null && returns.length > 0) { - // CName constructor = (CName) returns[0]; - // return constructor.getStringValue(); + CNameType constructor = ((CNameType) returns[0]); + return constructor.getStringValue(); } return null; @@ -1131,8 +1194,11 @@ public class SurfaceAreaQuery { Object[] returns = get("Externs", xPath); if (returns != null && returns.length > 0) { - // CName destructor = (CName) returns[0]; - // return destructor.getStringValue(); + // + // Only support one Destructor function. + // + CNameType destructor = (CNameType) returns[0]; + return destructor.getStringValue(); } return null; @@ -1318,14 +1384,28 @@ public class SurfaceAreaQuery { return result; } - public static XmlObject getFpdUserExtension() { - String[] xPath = new String[] { "" }; + public static Node getFpdUserExtensionPreBuild() { + String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" }; Object[] queryResult = get("PlatformSurfaceArea", xPath); - if (queryResult == null) { + if (queryResult == null || queryResult.length == 0) { return null; } - return null; + UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0]; + + return a.getDomNode(); + } + + public static Node getFpdUserExtensionPostBuild() { + String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" }; + + Object[] queryResult = get("PlatformSurfaceArea", xPath); + if (queryResult == null || queryResult.length == 0) { + return null; + } + UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0]; + + return a.getDomNode(); } /** @@ -1517,81 +1597,7 @@ public class SurfaceAreaQuery { return null; } - // PcdCoded.PcdData[] pcds = (PcdCoded.PcdData[]) returns; - // String[][] result = new String[pcds.length][2]; - // for (int i = 0; i < returns.length; ++i) { - // if (pcds[i].getItemType() != null) { - // result[i][1] = pcds[i].getItemType().toString(); - // } else { - // result[i][1] = null; - // } - // result[i][0] = pcds[i].getCName(); - // } - - return null; - } - - /** - * Get the PcdToken array from module's surface area document. The array - * should contains following data: - *

- * ------------------------------------------------------------------- - *

- *

- * CName | ItemType | TokenspaceName | DefaultValue | Usage | HelpText - *

- *

- * ------------------------------------------------------------------- - *

- *

- * Note: Until new schema applying, now we can only get CName, ItemType, - *

- * - * @return 2-array table contains all information of PCD token retrieved - * from MSA. - */ - public static Object[][] etModulePCDTokenArray() { return null; - // int index; - // Object[][] result; - // PCDs.PcdData[] pcds; - // String[] xPath = new String[] { "/PcdData" }; - // Object[] returns = get("PCDs", xPath); - // - // if ((returns == null) || (returns.length == 0)) { - // return null; - // } - // - // pcds = (PCDs.PcdData[]) returns; - // result = new Object[pcds.length][6]; - // for (index = 0; index < pcds.length; index++) { - // // - // // Get CName - // // - // result[index][0] = pcds[index].getCName(); - // // - // // Get ItemType: FEATURE_FLAG, FIXED_AT_BUILD, PATCHABLE_IN_MODLE, - // // DYNAMIC, DYNAMIC_EX - // // - // if (pcds[index].getItemType() != null) { - // result[index][1] = pcds[index].getItemType().toString(); - // } else { - // result[index][1] = null; - // } - // - // // - // // BUGBUG: following field can *not* be got from current MSA until - // // schema changed. - // // - // // result [index][2] = pcds[index].getTokenSpaceName(); - // result[index][2] = null; - // result[index][3] = pcds[index].getDefaultValue(); - // // result [index][4] = pcds[index].getUsage (); - // result[index][4] = null; - // // result [index][5] = pcds[index].getHelpText (); - // result[index][5] = null; - // } - // return result; } /** @@ -1646,9 +1652,8 @@ public class SurfaceAreaQuery { String[] specificationList = new String[queryResult.length]; for (int i = 0; i < queryResult.length; i++) { - // specificationList[i] = ((SpecificationDocument.Specification) - // queryResult[i]) - // .getStringValue(); + specificationList[i] = ((Sentence)queryResult[i]) + .getStringValue(); } return specificationList; } @@ -1714,7 +1719,7 @@ public class SurfaceAreaQuery { if (returns == null) { return packageIncludeMap; } -// GlobalData.log.info("" + returns[0].getClass().getName()); + for (int i = 0; i < returns.length; i++) { PackageHeadersDocument.PackageHeaders.IncludePkgHeader includeHeader = (PackageHeadersDocument.PackageHeaders.IncludePkgHeader) returns[i]; packageIncludeMap.put(includeHeader.getModuleType().toString(), @@ -1765,6 +1770,9 @@ public class SurfaceAreaQuery { guidPair[0] = entry.getCName(); guidPair[1] = entry.getGuidValue(); guidDeclMap.put(entry.getName(), guidPair); + EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName()); + EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[0]); + EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[1]); } return guidDeclMap; } @@ -1793,6 +1801,9 @@ public class SurfaceAreaQuery { protocolPair[0] = entry.getCName(); protocolPair[1] = entry.getGuidValue(); protoclMap.put(entry.getName(), protocolPair); + EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName()); + EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[0]); + EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[1]); } return protoclMap; } @@ -1829,31 +1840,6 @@ public class SurfaceAreaQuery { return ppiMap; } - /** - * getToolChainFamily - * - * This function is to retrieve ToolChainFamily attribute of FPD - * - * - * @param - * @return toolChainFamily If find toolChainFamily attribute in - * Null If don't have toolChainFamily in - * . - */ - public String getToolChainFamily() { - String toolChainFamily; - String[] xPath = new String[] { "/BuildOptions" }; - - Object[] result = get("PlatformSurfaceArea", xPath); - if (result == null) { - return null; - } - // toolChainFamily = - // ((BuildOptionsDocument.BuildOptions)result[0]).getToolChainFamilies(); - // return toolChainFamily; - return null; - } - /** * Retrieve module Guid string * @@ -1885,4 +1871,49 @@ public class SurfaceAreaQuery { return new ModuleSADocument.ModuleSA[0]; } + /** + Get name array of PCD in a module. In one module, token space + is same, and token name should not be conflicted. + + @return String[] + **/ + public static String[] getModulePcdEntryNameArray() { + PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries = null; + String[] results; + int index; + String[] xPath = new String[] {"/PcdEntry"}; + Object[] returns = get ("PcdCoded", xPath); + + if (returns == null) { + return new String[0]; + } + + pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns; + results = new String[pcdEntries.length]; + + for (index = 0; index < pcdEntries.length; index ++) { + results[index] = pcdEntries[index].getCName(); + } + return results; + } + + /** + Search in a List for a given string + + @return boolean + **/ + public static boolean contains(List list, String str) { + if (list == null || list.size()== 0) { + return true; + } + Iterator it = list.iterator(); + while (it.hasNext()) { + String s = (String)it.next(); + if (s.equalsIgnoreCase(str)) { + return true; + } + } + + return false; + } }