Class LazyName
- java.lang.Object
-
- org.inferred.freebuilder.processor.source.ValueType
-
- org.inferred.freebuilder.processor.source.LazyName
-
- All Implemented Interfaces:
Excerpt,Scope.Key<LazyName.Declaration>
public class LazyName extends ValueType implements Excerpt, Scope.Key<LazyName.Declaration>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLazyName.DeclarationA Declaration maps a unique static class name to its static excerpt in a scope.-
Nested classes/interfaces inherited from class org.inferred.freebuilder.processor.source.ValueType
ValueType.FieldReceiver
-
-
Field Summary
Fields Modifier and Type Field Description private Excerptdefinitionprivate java.lang.StringpreferredName
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFields(ValueType.FieldReceiver fields)Implement this method to report the name and value of each field.static voidaddLazyDefinitions(SourceBuilder code)Finds all lazily-declared classes and methods and adds their definitions to the source.voidaddTo(SourceBuilder code)Scope.Levellevel()static <E extends ValueType & Excerpt>
LazyNameof(java.lang.String preferredName, E definition)
-
-
-
Field Detail
-
preferredName
private final java.lang.String preferredName
-
definition
private final Excerpt definition
-
-
Constructor Detail
-
LazyName
private LazyName(java.lang.String preferredName, Excerpt definition)A LazyName, when first used, determines a unique name, usingpreferredNameif still available, and registers thedefinitionto be added later.
-
-
Method Detail
-
addLazyDefinitions
public static void addLazyDefinitions(SourceBuilder code)
Finds all lazily-declared classes and methods and adds their definitions to the source.
-
of
public static <E extends ValueType & Excerpt> LazyName of(java.lang.String preferredName, E definition)
-
addFields
protected void addFields(ValueType.FieldReceiver fields)
Description copied from class:ValueTypeImplement this method to report the name and value of each field.
-
level
public Scope.Level level()
- Specified by:
levelin interfaceScope.Key<LazyName.Declaration>
-
addTo
public void addTo(SourceBuilder code)
-
-