/** * Adds an adaptation to the given kind. */ public ElementCreatorImpl adapt(String kind, ElementKey<?, ?> adaptation) { synchronized (registry) { adaptations.put(kind, adaptation); registry.register(adaptation); registry.dirty(); } return this; }
/** * Adds an adaptation to the given kind. */ public ElementCreatorImpl adapt(String kind, ElementKey<?, ?> adaptation) { synchronized (registry) { adaptations.put(kind, adaptation); registry.register(adaptation); registry.dirty(); } return this; }
/** * Adds an adaptation to the given kind. */ public ElementCreatorImpl adapt(String kind, ElementKey<?, ?> adaptation) { synchronized (registry) { adaptations.put(kind, adaptation); registry.register(adaptation); registry.dirty(); } return this; }
/** * Builds metadata for when the {@code key} is inside the {@code parent} and * used in a context compatible with {@code context}. Note that this will not * declare the element as part of the parent element, that must be done using * {@link ElementCreator#addElement(ElementKey)} or * {@link ElementCreator#replaceElement(ElementKey)}. * * <p>This will also guarantee that any element types that are referenced * have been registered in this registry. */ public ElementCreator build(ElementKey<?, ?> parent, ElementKey<?, ?> element, MetadataContext context) { ElementCreatorImpl creator = getOrCreateElement(element).build( parent, element, context); // If there is a parent or context this isn't a basic registration, so force // basic registration to take place. if (parent != null || context != null) { register(element); } return creator; }
/** * Builds metadata for when the {@code key} is inside the {@code parent} and * used in a context compatible with {@code context}. Note that this will not * declare the element as part of the parent element, that must be done using * {@link ElementCreator#addElement(ElementKey)} or * {@link ElementCreator#replaceElement(ElementKey)}. * * <p>This will also guarantee that any element types that are referenced * have been registered in this registry. */ public ElementCreator build(ElementKey<?, ?> parent, ElementKey<?, ?> element, MetadataContext context) { ElementCreatorImpl creator = getOrCreateElement(element).build( parent, element, context); // If there is a parent or context this isn't a basic registration, so force // basic registration to take place. if (parent != null || context != null) { register(element); } return creator; }
/** * Builds metadata for when the {@code key} is inside the {@code parent} and * used in a context compatible with {@code context}. Note that this will not * declare the element as part of the parent element, that must be done using * {@link ElementCreator#addElement(ElementKey)} or * {@link ElementCreator#replaceElement(ElementKey)}. * * <p>This will also guarantee that any element types that are referenced * have been registered in this registry. */ public ElementCreator build(ElementKey<?, ?> parent, ElementKey<?, ?> element, MetadataContext context) { ElementCreatorImpl creator = getOrCreateElement(element).build( parent, element, context); // If there is a parent or context this isn't a basic registration, so force // basic registration to take place. if (parent != null || context != null) { register(element); } return creator; }