Skip to content

Commit

Permalink
Updates API
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Jun 14, 2015
1 parent dc7e03e commit 411348d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 0 additions & 2 deletions api/src/main/java/jd/gui/api/model/Type.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public interface Type {

public String getName();

public String getShortName();

public String getSuperName();

public String getOuterName();
Expand Down
11 changes: 11 additions & 0 deletions api/src/main/java/jd/gui/spi/TypeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@
import jd.gui.api.model.Container;
import jd.gui.api.model.Type;

import java.util.Collection;
import java.util.regex.Pattern;

public interface TypeFactory {
public String[] getSelectors();

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);
}
2 changes: 1 addition & 1 deletion app/src/main/groovy/jd/gui/util/UriUtil.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 411348d

Please sign in to comment.