|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.textgrid.utils.linkrewriter.AbstractReplacement
public abstract class AbstractReplacement extends Object
The base class for replacements used in the link rewriter.
A replacement is responsible for replacing one link in the source file with the destination link.
Modifier and Type | Field and Description |
---|---|
protected String |
from
|
protected String |
to
|
Constructor and Description |
---|
AbstractReplacement(String from,
String to)
Creates a replacement that replaces the URL specified by from with the URL specified by to. |
Modifier and Type | Method and Description | |
---|---|---|
static String |
apply(List<? extends AbstractReplacement> replacements,
String s)
|
|
abstract String |
apply(String in)
applies this replacement to the given string. |
|
static
|
create(Class<T> replacementType,
ImportMapping mapping,
boolean export)
Creates a list of replacements that can be applied to strings. |
|
static
|
create(Class<T> replacementType,
ImportObject object,
boolean export)
This is a convenience method that instantiates a conforming replacement implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final String from
protected final String to
Constructor Detail |
---|
public AbstractReplacement(String from, String to)
create(Class, ImportObject, boolean)
or
create(Class, ImportMapping, boolean)
fails!
Method Detail |
---|
public abstract String apply(String in)
public static <T extends AbstractReplacement> List<T> create(Class<T> replacementType, ImportMapping mapping, boolean export)
T
- The replacement implementation to use.replacementType
- The class of implementation to usemapping
- The mapping to implementexport
- If true, replace from textgrid url to local urlpublic static <T extends AbstractReplacement> T create(Class<T> replacementType, ImportObject object, boolean export) throws IllegalArgumentException, IllegalStateException
T
- The type of replacement to instantiatereplacementType
- the replacement implementationobject
- The mapping object used for the instantiationexport
- whether this is an export type replacement (from textgrid: uri
to local uri)IllegalArgumentException
- when the class passed in doesn't conform to the specificationIllegalStateException
- when something else goes wrong during instantiation: See the
nested exception for details.public static String apply(List<? extends AbstractReplacement> replacements, String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |