1 19 package org.java.plugin.registry.xml; 20 21 import org.java.plugin.registry.Documentation; 22 import org.java.plugin.registry.Identity; 23 import org.java.plugin.registry.ManifestProcessingException; 24 import org.java.plugin.registry.PluginDescriptor; 25 import org.java.plugin.registry.PluginElement; 26 import org.java.plugin.registry.PluginFragment; 27 28 31 abstract class PluginElementImpl extends IdentityImpl implements PluginElement { 32 private final PluginDescriptor descriptor; 33 private final PluginFragment fragment; 34 private DocumentationImpl doc; 35 36 protected PluginElementImpl(final PluginDescriptor descr, 37 final PluginFragment aFragment, final String id, 38 final ModelDocumentation modelDoc) 39 throws ManifestProcessingException { 40 super(id); 41 descriptor = descr; 42 fragment = aFragment; 43 if (modelDoc != null) { 44 doc = new DocumentationImpl(this, modelDoc); 45 } 46 } 47 48 52 protected boolean isEqualTo(final Identity idt) { 53 if (!getClass().getName().equals(idt.getClass().getName())) { 54 return false; 55 } 56 return getDeclaringPluginDescriptor().equals( 57 ((PluginElementImpl) idt).getDeclaringPluginDescriptor()) 58 && getId().equals(idt.getId()); 59 } 60 61 64 public PluginDescriptor getDeclaringPluginDescriptor() { 65 return descriptor; 66 } 67 68 71 public PluginFragment getDeclaringPluginFragment() { 72 return fragment; 73 } 74 75 78 public Documentation getDocumentation() { 79 return doc; 80 } 81 82 85 public String getDocsPath() { 86 return (fragment != null) ? fragment.getDocsPath() 87 : descriptor.getDocsPath(); 88 } 89 } 90 | Popular Tags |