Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2003, 2010 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.core.runtime.internal.adaptor;
 
Internal class.
 
 public class CachedManifest extends Dictionary {
 	static final String SERVICE_COMPONENT = "Service-Component"//$NON-NLS-1$
 	static boolean DEBUG = false;
 	private Dictionary manifest = null;
 
 	public CachedManifest(EclipseStorageHook storageHook) {
 		this. = storageHook;
 	}
 
 	public Dictionary getManifest() {
 		if ( == null)
 			try {
 				if ()
 					..println("Reading manifest for: " + .getBaseData()); //$NON-NLS-1$
 			} catch (BundleException e) {
 				return null;
 			}
 		if ( == null) {
 			Headers empty = new Headers(0);
 			empty.setReadOnly();
 			 = empty;
 			return empty;
 		}
 		return ;
 	}
 
 	public int size() {
 		return getManifest().size();
 	}
 
 	public boolean isEmpty() {
 		return size() == 0;
 	}
 
 	public Enumeration elements() {
 		return getManifest().elements();
 	}
 
 	public Enumeration keys() {
 		return getManifest().keys();
 	}
 
 	public Object get(Object key) {
 		if ( != null)
 			return .get(key);
 		String keyString = (Stringkey;
 			return result == null ? null : result.toString();
 		}
 			return .getBaseData().getSymbolicName() + ';' + . + ":=true"//$NON-NLS-1$
 		}
 				return null;
			if (excludes == null && includes == null)
			if (excludes != null) {
				result.append(';').append(.).append(":=\""); //$NON-NLS-1$
				for (int i = 0; i < excludes.lengthi++) {
					if (i > 0)
						result.append(',');
					result.append(excludes[i]);
				}
				result.append("\""); //$NON-NLS-1$
			}
			if (includes != null) {
				result.append(';').append(.).append(":=\""); //$NON-NLS-1$
				for (int i = 0; i < includes.lengthi++) {
					if (i > 0)
						result.append(',');
					result.append(includes[i]);
				}
				result.append("\""); //$NON-NLS-1$
			}
		}
				return null;
			result.append(";").append(.).append("=\""); //$NON-NLS-1$ //$NON-NLS-2$
			for (int i = 0; i < exceptions.lengthi++) {
				if (i > 0)
					result.append(","); //$NON-NLS-1$
				result.append(exceptions[i]);
			}
			result.append("\""); //$NON-NLS-1$
			return result.toString();
		}
		if (.equals(keyString))
		Dictionary result = getManifest();
		if ()
			..println("Manifest read because of header: " + key); //$NON-NLS-1$
		return result == null ? null : result.get(key);
	}
	public Object remove(Object key) {
		return getManifest().remove(key);
	}
	public Object put(Object keyObject value) {
		return getManifest().put(keyvalue);
	}
New to GrepCode? Check out our FAQ X