1 11 package org.eclipse.osgi.internal.resolver; 12 13 import java.util.Dictionary ; 14 import org.eclipse.osgi.service.resolver.BundleDescription; 15 import org.eclipse.osgi.service.resolver.GenericDescription; 16 import org.osgi.framework.Constants; 17 18 public class GenericDescriptionImpl extends BaseDescriptionImpl implements GenericDescription { 19 private Dictionary attributes; 20 private BundleDescription supplier; 21 private String type = GenericDescription.DEFAULT_TYPE; 22 23 public Dictionary getAttributes() { 24 return attributes; 25 } 26 27 public BundleDescription getSupplier() { 28 return supplier; 29 } 30 31 void setAttributes(Dictionary attributes) { 32 this.attributes = attributes; 33 attributes.put(Constants.VERSION_ATTRIBUTE, getVersion()); 35 } 36 37 void setSupplier(BundleDescription supplier) { 38 this.supplier = supplier; 39 } 40 41 public String toString() { 42 StringBuffer sb = new StringBuffer (); 43 sb.append(StateBuilder.GENERIC_CAPABILITY).append(": ").append(getName()); if (getType() != GenericDescription.DEFAULT_TYPE) 45 sb.append(':').append(getType()); 46 return sb.toString(); 47 } 48 49 public String getType() { 50 return type; 51 } 52 53 void setType(String type) { 54 if (type == null || type.equals(GenericDescription.DEFAULT_TYPE)) 55 this.type = GenericDescription.DEFAULT_TYPE; 56 else 57 this.type = type; 58 } 59 } 60 | Popular Tags |