Package com.adobe.epubcheck.opf
Class MetadataSet.Builder
- java.lang.Object
-
- com.adobe.epubcheck.opf.MetadataSet.Builder
-
- Enclosing class:
- MetadataSet
public static final class MetadataSet.Builder extends java.lang.ObjectA builder for sets of metadata expressions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classMetadataSet.Builder.Visit
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.Multimap<Property,MetadataSet.Metadata>allprivate com.google.common.collect.Multimap<Property,MetadataSet.Metadata>primaryprivate com.google.common.collect.Multimap<java.lang.String,MetadataSet.Metadata>refinersMapprivate java.util.Map<MetadataSet.Metadata,MetadataSet.Metadata>refinesprivate java.util.LinkedList<MetadataSet.Metadata>tempMetasprivate java.util.Map<MetadataSet.Metadata,MetadataSet.Builder.Visit>visits
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadataSetbuild()Builds the set.private MetadataSet.Metadatabuild(MetadataSet.Metadata meta)MetadataSet.Buildermeta(java.lang.String id, Property property, java.lang.String value, java.lang.String refines)Adds a metadata expression to the set being built.
-
-
-
Field Detail
-
primary
private final com.google.common.collect.Multimap<Property,MetadataSet.Metadata> primary
-
all
private final com.google.common.collect.Multimap<Property,MetadataSet.Metadata> all
-
tempMetas
private final java.util.LinkedList<MetadataSet.Metadata> tempMetas
-
refinersMap
private final com.google.common.collect.Multimap<java.lang.String,MetadataSet.Metadata> refinersMap
-
refines
private final java.util.Map<MetadataSet.Metadata,MetadataSet.Metadata> refines
-
visits
private final java.util.Map<MetadataSet.Metadata,MetadataSet.Builder.Visit> visits
-
-
Method Detail
-
build
public MetadataSet build()
Builds the set. Must be called after all metadata expressions have been added.- Returns:
- an immutable metadata set
- Throws:
java.lang.IllegalStateException- if a cycle is found in the graph of refining expressions
-
build
private MetadataSet.Metadata build(MetadataSet.Metadata meta)
-
meta
public MetadataSet.Builder meta(java.lang.String id, Property property, java.lang.String value, java.lang.String refines)
Adds a metadata expression to the set being built.- Parameters:
id- the ID of the element holding the expression, can be null.property- the property representing the statement of the expression (must not be null)value- the value representing the assertion of the expression (can, but should not, be null)refines- the ID of the expression or resource refined by this expression. If the given string starts with the character '#' (relative fragment URI), it is stripped to get the ID. Can be null- Returns:
- this builder
-
-