/** * Builds the metadata for the attribute inside the parent, during the * context. Note that this will not declare the attribute as part of the * parent element, that must be done using * {@link ElementCreator#addAttribute(AttributeKey)} or * {@link ElementCreator#replaceAttribute(AttributeKey)}. */ public AttributeCreator build(ElementKey<?, ?> parent, AttributeKey<?> attribute, MetadataContext context) { return getOrCreateAttribute(attribute).build(parent, attribute, context); }
/** * Creates the immutable map of attribute key -> attribute registry. Once * this is created there is no more modifying attribute metadata, its all set. */ private static ImmutableMap<RootKey, AttributeMetadataRegistry> buildAttributes(MetadataRegistry registry, Schema schema) { Builder<RootKey, AttributeMetadataRegistry> attributeBuilder = ImmutableMap.builder(); for (Map.Entry<RootKey, AttributeMetadataRegistryBuilder> entry : registry.getAttributes().entrySet()) { attributeBuilder.put(entry.getKey(), entry.getValue().create(schema)); } return attributeBuilder.build(); }
/** * Creates a new attribute registry from the given builder. */ AttributeMetadataRegistry(Schema schema, AttributeMetadataRegistryBuilder builder) { this.schema = schema; this.transforms = getTransforms(builder.getCreators()); }
AttributeMetadataRegistryBuilder builder = attributes.get(key); if (builder == null) { builder = new AttributeMetadataRegistryBuilder(this); attributes.put(key, builder); builder.merge(entry.getValue());
/** * Returns the existing element registry for the given key, or creates it if * it does not already exist. */ private synchronized AttributeMetadataRegistryBuilder getOrCreateAttribute( AttributeKey<?> key) { RootKey rootKey = Schema.getRootKey(key); AttributeMetadataRegistryBuilder attRegistry = attributes.get(rootKey); if (attRegistry == null) { attRegistry = new AttributeMetadataRegistryBuilder(this); attributes.put(rootKey, attRegistry); } dirty(); return attRegistry; }
AttributeMetadataRegistryBuilder builder = attributes.get(key); if (builder == null) { builder = new AttributeMetadataRegistryBuilder(this); attributes.put(key, builder); builder.merge(entry.getValue());
/** * Returns the existing element registry for the given key, or creates it if * it does not already exist. */ private synchronized AttributeMetadataRegistryBuilder getOrCreateAttribute( AttributeKey<?> key) { RootKey rootKey = Schema.getRootKey(key); AttributeMetadataRegistryBuilder attRegistry = attributes.get(rootKey); if (attRegistry == null) { attRegistry = new AttributeMetadataRegistryBuilder(this); attributes.put(rootKey, attRegistry); } dirty(); return attRegistry; }
AttributeMetadataRegistryBuilder builder = attributes.get(key); if (builder == null) { builder = new AttributeMetadataRegistryBuilder(this); attributes.put(key, builder); builder.merge(entry.getValue());
/** * Builds the metadata for the attribute inside the parent, during the * context. Note that this will not declare the attribute as part of the * parent element, that must be done using * {@link ElementCreator#addAttribute(AttributeKey)} or * {@link ElementCreator#replaceAttribute(AttributeKey)}. */ public AttributeCreator build(ElementKey<?, ?> parent, AttributeKey<?> attribute, MetadataContext context) { return getOrCreateAttribute(attribute).build(parent, attribute, context); }
/** * Creates a new attribute registry from the given builder. */ AttributeMetadataRegistry(Schema schema, AttributeMetadataRegistryBuilder builder) { this.schema = schema; this.transforms = getTransforms(builder.getCreators()); }
/** * Creates the immutable map of attribute key -> attribute registry. Once * this is created there is no more modifying attribute metadata, its all set. */ private static ImmutableMap<RootKey, AttributeMetadataRegistry> buildAttributes(MetadataRegistry registry, Schema schema) { Builder<RootKey, AttributeMetadataRegistry> attributeBuilder = ImmutableMap.builder(); for (Map.Entry<RootKey, AttributeMetadataRegistryBuilder> entry : registry.getAttributes().entrySet()) { attributeBuilder.put(entry.getKey(), entry.getValue().create(schema)); } return attributeBuilder.build(); }
/** * Returns the existing element registry for the given key, or creates it if * it does not already exist. */ private synchronized AttributeMetadataRegistryBuilder getOrCreateAttribute( AttributeKey<?> key) { RootKey rootKey = Schema.getRootKey(key); AttributeMetadataRegistryBuilder attRegistry = attributes.get(rootKey); if (attRegistry == null) { attRegistry = new AttributeMetadataRegistryBuilder(this); attributes.put(rootKey, attRegistry); } dirty(); return attRegistry; }
/** * Builds the metadata for the attribute inside the parent, during the * context. Note that this will not declare the attribute as part of the * parent element, that must be done using * {@link ElementCreator#addAttribute(AttributeKey)} or * {@link ElementCreator#replaceAttribute(AttributeKey)}. */ public AttributeCreator build(ElementKey<?, ?> parent, AttributeKey<?> attribute, MetadataContext context) { return getOrCreateAttribute(attribute).build(parent, attribute, context); }
/** * Creates a new attribute registry from the given builder. */ AttributeMetadataRegistry(Schema schema, AttributeMetadataRegistryBuilder builder) { this.schema = schema; this.transforms = getTransforms(builder.getCreators()); }
/** * Creates the immutable map of attribute key -> attribute registry. Once * this is created there is no more modifying attribute metadata, its all set. */ private static ImmutableMap<RootKey, AttributeMetadataRegistry> buildAttributes(MetadataRegistry registry, Schema schema) { Builder<RootKey, AttributeMetadataRegistry> attributeBuilder = ImmutableMap.builder(); for (Map.Entry<RootKey, AttributeMetadataRegistryBuilder> entry : registry.getAttributes().entrySet()) { attributeBuilder.put(entry.getKey(), entry.getValue().create(schema)); } return attributeBuilder.build(); }