public abstract class TypeWithMembers<T extends TypeWithMembers<T>> extends GoloType<T>
Modifier and Type | Method and Description |
---|---|
protected void |
addMember(Member member) |
java.util.List<GoloElement<?>> |
children()
Returns a list of all the direct children of this node.
|
java.util.Set<GoloFunction> |
createFactories()
Creates the factory functions for this type.
|
protected GoloFunction |
createFullArgsConstructor() |
protected java.lang.String |
getFactoryDelegateName() |
protected java.lang.Object[] |
getFullArgs() |
protected java.util.List<java.lang.String> |
getMemberNames() |
java.util.Set<Member> |
getMembers() |
java.util.List<Member> |
getPublicMembers() |
boolean |
hasMembers() |
T |
members(java.lang.Object... members)
Adds all members to this type.
|
protected void |
replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
T |
withMember(java.lang.Object member)
Adds a member to this type.
|
getName, getPackageAndClass
accept, ancestor, ancestor, ancestorOfType, cantConvert, cantReplace, cantReplace, children, children, descendants, descendants, descendants, documentation, documentation, doesNotContain, enclosingModule, getLocalReferenceTable, hasParent, hasPosition, makeParentOf, metadata, metadata, next, next, next, ofAST, parent, positionInSourceCode, positionInSourceCode, previous, previous, previous, replaceInParentBy, self, walk
protected java.lang.String getFactoryDelegateName()
public T members(java.lang.Object... members)
withMember(Object)
public boolean hasMembers()
public T withMember(java.lang.Object member)
This is a builder method.
member
- a Member
or any object whose toString
method is used to create a member object.protected java.util.List<java.lang.String> getMemberNames()
public java.util.Set<Member> getMembers()
public java.util.List<Member> getPublicMembers()
protected java.lang.Object[] getFullArgs()
public java.util.Set<GoloFunction> createFactories()
Internal API
protected GoloFunction createFullArgsConstructor()
public java.util.List<GoloElement<?>> children()
children
in class GoloElement<T extends TypeWithMembers<T>>
protected void replaceElement(GoloElement<?> original, GoloElement<?> newElement)
Replace original
with newElement
if original
is a child of this node
and type matches.
replaceElement
in class GoloElement<T extends TypeWithMembers<T>>
original
- the original value to replace. Must be a child of this nodenewElement
- the element to replace with. Type must match.GoloElement.cantReplace()
,
GoloElement.cantReplace(GoloElement, GoloElement)
,
GoloElement.doesNotContain(GoloElement)
,
GoloElement.cantConvert(String, Object)