W - Type of SymbolWriter to create.@FunctionalInterface
public static interface SymbolWriter.Factory<W extends SymbolWriter<W,? extends ImportContainer>>
extends java.util.function.BiFunction<java.lang.String,java.lang.String,W>
SymbolWriter.
The following example shows how to implement a basic Factory.
public final class MyWriterFactory implements SymbolWriter.Factory<MyWriter> {
\@Override
public MyWriter apply(String filename, String namespace) {
return new MyWriter(namespace);
}
}
Because this class is a FunctionalInterface, it can be implemented
using a lambda expression:
SymbolWriter.Factory<MyWriter> = (filename, namespace) -> new MyWriter(namespace);
| Modifier and Type | Method and Description |
|---|---|
W |
apply(java.lang.String filename,
java.lang.String namespace)
Creates a
SymbolWriter of type T for the given
filename and namespace. |
W apply(java.lang.String filename, java.lang.String namespace)
SymbolWriter of type T for the given
filename and namespace.apply in interface java.util.function.BiFunction<java.lang.String,java.lang.String,W extends SymbolWriter<W,? extends ImportContainer>>filename - Non-null filename of the writer being created.namespace - Non-null namespace associated with the file (possibly empty string).T.