Updates API

This commit is contained in:
emmanue1 2015-06-14 11:39:13 +02:00
parent dc7e03e5c2
commit 411348dc6b
3 changed files with 12 additions and 3 deletions

View File

@ -24,8 +24,6 @@ public interface Type {
public String getName();
public String getShortName();
public String getSuperName();
public String getOuterName();

View File

@ -9,6 +9,7 @@ import jd.gui.api.API;
import jd.gui.api.model.Container;
import jd.gui.api.model.Type;
import java.util.Collection;
import java.util.regex.Pattern;
public interface TypeFactory {
@ -16,5 +17,15 @@ public interface TypeFactory {
public Pattern getPathPattern();
/**
* @return all root types contains in 'entry'
*/
public Collection<Type> make(API api, Container.Entry entry);
/**
* @param fragment @see jd.gui.api.feature.UriOpenable
* @return if 'fragment' is null, return the main type in 'entry',
* otherwise, return the type or sub-type matching with 'fragment'
*/
public Type make(API api, Container.Entry entry, String fragment);
}

View File

@ -18,7 +18,7 @@ class UriUtil {
* file://codebase/a/b/c/D$E.class => file://codebase/a/b/c/D.class#typeDeclaration=D$E
*/
static URI createURI(API api, Collection<Indexes> collectionOfIndexes, Container.Entry entry, String query, String fragment) {
def type = TypeFactoryService.instance.get(entry)?.make(api, entry, null)
def type = TypeFactoryService.instance.get(entry)?.make(api, entry, fragment)
def uri = entry.uri
def path = type?.outerName ? getOuterPath(collectionOfIndexes, entry, type) : uri.path
return new URI(uri.scheme, uri.host, path, query, fragment)