public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
private boolean exceptionsAttributesValid(IHeader header, ManifestElement[] elements) { if (elements == null || elements.length == 0) return true; int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_UNKNOWN_ATTRIBUTE); if (severity == CompilerFlags.IGNORE) return true; Enumeration<?> keys = elements[0].getKeys(); if (keys != null && keys.hasMoreElements()) { String key = (String) keys.nextElement(); if ("exceptions".equals(key)) { //$NON-NLS-1$ String[] values = elements[0].getAttributes(key); for (int i = 0; i < values.length; i++) { StringTokenizer st = new StringTokenizer(values[i], ","); //$NON-NLS-1$ while (st.hasMoreTokens()) { String name = st.nextToken().trim(); if (!getExportedPackages().contains(name)) { String message = NLS.bind(PDECoreMessages.BundleErrorReporter_NotExistInProject, name); report(message, getLine(header, name), CompilerFlags.P_UNRESOLVED_IMPORTS, PDEMarkerFactory.CAT_OTHER); return false; } } } } } return true; }
public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
private boolean exceptionsAttributesValid(IHeader header, ManifestElement[] elements) { if (elements == null || elements.length == 0) return true; int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_UNKNOWN_ATTRIBUTE); if (severity == CompilerFlags.IGNORE) return true; Enumeration keys = elements[0].getKeys(); if (keys != null && keys.hasMoreElements()) { String key = (String) keys.nextElement(); if ("exceptions".equals(key)) { //$NON-NLS-1$ String[] values = elements[0].getAttributes(key); for (int i = 0; i < values.length; i++) { StringTokenizer st = new StringTokenizer(values[i], ","); //$NON-NLS-1$ while (st.hasMoreTokens()) { String name = st.nextToken().trim(); if (!getExportedPackages().contains(name)) { String message = NLS.bind(PDECoreMessages.BundleErrorReporter_NotExistInProject, name); report(message, getLine(header, name), CompilerFlags.P_UNRESOLVED_IMPORTS, PDEMarkerFactory.CAT_OTHER); return false; } } } } } return true; }
public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
public String toString() { Enumeration<String> attrKeys = getKeys(); Enumeration<String> directiveKeys = getDirectiveKeys(); if (attrKeys == null && directiveKeys == null) return mainValue; StringBuffer result = new StringBuffer(mainValue); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); addValues(false, key, getAttributes(key), result); } } if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); addValues(true, key, getDirectives(key), result); } } return result.toString(); }
private static void checkForDuplicateDirectivesAttributes(String headerKey, ManifestElement[] elements) throws BundleException { // check for duplicate directives for (int i = 0; i < elements.length; i++) { Enumeration<String> directiveKeys = elements[i].getDirectiveKeys(); if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); String[] directives = elements[i].getDirectives(key); if (directives.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(NLS.bind(message + " : " + Msg.HEADER_DIRECTIVE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } Enumeration<String> attrKeys = elements[i].getKeys(); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); String[] attrs = elements[i].getAttributes(key); if (attrs.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(message + " : " + NLS.bind(Msg.HEADER_ATTRIBUTE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } } }
private static void checkForDuplicateDirectivesAttributes(String headerKey, ManifestElement[] elements) throws BundleException { // check for duplicate directives for (int i = 0; i < elements.length; i++) { Enumeration<String> directiveKeys = elements[i].getDirectiveKeys(); if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); String[] directives = elements[i].getDirectives(key); if (directives.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(NLS.bind(message + " : " + StateMsg.HEADER_DIRECTIVE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } Enumeration<String> attrKeys = elements[i].getKeys(); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); String[] attrs = elements[i].getAttributes(key); if (attrs.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(message + " : " + NLS.bind(StateMsg.HEADER_ATTRIBUTE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } } }
private static void checkForDuplicateDirectivesAttributes(String headerKey, ManifestElement[] elements) throws BundleException { // check for duplicate directives for (int i = 0; i < elements.length; i++) { Enumeration<String> directiveKeys = elements[i].getDirectiveKeys(); if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); String[] directives = elements[i].getDirectives(key); if (directives.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(NLS.bind(message + " : " + StateMsg.HEADER_DIRECTIVE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } Enumeration<String> attrKeys = elements[i].getKeys(); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); String[] attrs = elements[i].getAttributes(key); if (attrs.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(message + " : " + NLS.bind(StateMsg.HEADER_ATTRIBUTE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } } }
private static void checkForDuplicateDirectivesAttributes(String headerKey, ManifestElement[] elements) throws BundleException { // check for duplicate directives for (int i = 0; i < elements.length; i++) { Enumeration<String> directiveKeys = elements[i].getDirectiveKeys(); if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); String[] directives = elements[i].getDirectives(key); if (directives.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(NLS.bind(message + " : " + StateMsg.HEADER_DIRECTIVE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } Enumeration<String> attrKeys = elements[i].getKeys(); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); String[] attrs = elements[i].getAttributes(key); if (attrs.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(message + " : " + NLS.bind(StateMsg.HEADER_ATTRIBUTE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } } }
private static NativeCodeDescriptionImpl createNativeCodeDescription(ManifestElement manifestElement) throws BundleException { NativeCodeDescriptionImpl result = new NativeCodeDescriptionImpl(); result.setName(Constants.BUNDLE_NATIVECODE); result.setNativePaths(manifestElement.getValueComponents()); result.setOSNames(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSNAME)); result.setProcessors(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_PROCESSOR)); result.setOSVersions(createVersionRanges(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSVERSION))); result.setLanguages(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_LANGUAGE)); try { result.setFilter(manifestElement.getAttribute(Constants.SELECTION_FILTER_ATTRIBUTE)); } catch (InvalidSyntaxException e) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, Constants.BUNDLE_NATIVECODE, manifestElement.toString()); throw new BundleException(message + " : " + Constants.SELECTION_FILTER_ATTRIBUTE, BundleException.MANIFEST_ERROR, e); //$NON-NLS-1$ } return result; }
private static NativeCodeDescriptionImpl createNativeCodeDescription(ManifestElement manifestElement) throws BundleException { NativeCodeDescriptionImpl result = new NativeCodeDescriptionImpl(); result.setName(Constants.BUNDLE_NATIVECODE); result.setNativePaths(manifestElement.getValueComponents()); result.setOSNames(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSNAME)); result.setProcessors(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_PROCESSOR)); result.setOSVersions(createVersionRanges(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSVERSION))); result.setLanguages(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_LANGUAGE)); try { result.setFilter(manifestElement.getAttribute(Constants.SELECTION_FILTER_ATTRIBUTE)); } catch (InvalidSyntaxException e) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, Constants.BUNDLE_NATIVECODE, manifestElement.toString()); throw new BundleException(message + " : " + Constants.SELECTION_FILTER_ATTRIBUTE, BundleException.MANIFEST_ERROR, e); //$NON-NLS-1$ } return result; }
private static void checkForDuplicateDirectivesAttributes(String headerKey, ManifestElement[] elements) throws BundleException { // check for duplicate directives for (int i = 0; i < elements.length; i++) { Enumeration<String> directiveKeys = elements[i].getDirectiveKeys(); if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); String[] directives = elements[i].getDirectives(key); if (directives.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(NLS.bind(message + " : " + Msg.HEADER_DIRECTIVE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } Enumeration<String> attrKeys = elements[i].getKeys(); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); String[] attrs = elements[i].getAttributes(key); if (attrs.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(message + " : " + NLS.bind(Msg.HEADER_ATTRIBUTE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } } }
private static NativeCodeDescriptionImpl createNativeCodeDescription(ManifestElement manifestElement) throws BundleException { NativeCodeDescriptionImpl result = new NativeCodeDescriptionImpl(); result.setName(Constants.BUNDLE_NATIVECODE); result.setNativePaths(manifestElement.getValueComponents()); result.setOSNames(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSNAME)); result.setProcessors(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_PROCESSOR)); result.setOSVersions(createVersionRanges(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSVERSION))); result.setLanguages(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_LANGUAGE)); try { result.setFilter(manifestElement.getAttribute(Constants.SELECTION_FILTER_ATTRIBUTE)); } catch (InvalidSyntaxException e) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, Constants.BUNDLE_NATIVECODE, manifestElement.toString()); throw new BundleException(message + " : " + Constants.SELECTION_FILTER_ATTRIBUTE, BundleException.MANIFEST_ERROR, e); //$NON-NLS-1$ } return result; }
private static void checkForDuplicateDirectivesAttributes(String headerKey, ManifestElement[] elements) throws BundleException { // check for duplicate directives for (int i = 0; i < elements.length; i++) { Enumeration<String> directiveKeys = elements[i].getDirectiveKeys(); if (directiveKeys != null) { while (directiveKeys.hasMoreElements()) { String key = directiveKeys.nextElement(); String[] directives = elements[i].getDirectives(key); if (directives.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(NLS.bind(message + " : " + Msg.HEADER_DIRECTIVE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } Enumeration<String> attrKeys = elements[i].getKeys(); if (attrKeys != null) { while (attrKeys.hasMoreElements()) { String key = attrKeys.nextElement(); String[] attrs = elements[i].getAttributes(key); if (attrs.length > 1) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[i].toString()); throw new BundleException(message + " : " + NLS.bind(Msg.HEADER_ATTRIBUTE_DUPLICATES, key), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } } } } }
private static NativeCodeDescriptionImpl createNativeCodeDescription(ManifestElement manifestElement) throws BundleException { NativeCodeDescriptionImpl result = new NativeCodeDescriptionImpl(); result.setName(Constants.BUNDLE_NATIVECODE); result.setNativePaths(manifestElement.getValueComponents()); result.setOSNames(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSNAME)); result.setProcessors(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_PROCESSOR)); result.setOSVersions(createVersionRanges(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_OSVERSION))); result.setLanguages(manifestElement.getAttributes(Constants.BUNDLE_NATIVECODE_LANGUAGE)); try { result.setFilter(manifestElement.getAttribute(Constants.SELECTION_FILTER_ATTRIBUTE)); } catch (InvalidSyntaxException e) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, Constants.BUNDLE_NATIVECODE, manifestElement.toString()); throw new BundleException(message + " : " + Constants.SELECTION_FILTER_ATTRIBUTE, BundleException.MANIFEST_ERROR, e); //$NON-NLS-1$ } return result; }