public abstract class XMLExporter
extends Object
Modifier | Constructor and Description |
---|---|
protected |
XMLExporter(Optional<ConfigExporter> owner)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addExporter(Class<? extends Entity> entityClass)
Adds this as the exporter for an Entity Class.
|
protected static boolean |
areDeferredSubstitutions(Object[] values)
Asks if all values are deferred substitutions.
|
protected XMLElement |
createElement(String name)
Creates an Element with the specified name.
|
protected Config |
getConfig()
Gets the config.
|
protected XMLDocument |
getDocument()
Gets the XML document.
|
protected abstract String |
getElementName()
Gets the XML element name.
|
protected Optional<? extends Entity> |
getEntity(String name,
String prefix)
Gets an entity.
|
protected ConfigExporter |
getOwner()
Gets the owner.
|
protected EntityReference |
getReference(Entity entity)
Gets the Reference to an Entity.
|
protected XMLElement |
getRootElement()
Gets the root Element.
|
protected boolean |
isWithAttributes()
Asks if attributes are required.
|
protected boolean |
isWithAttributes(String usage)
Asks if attributes for the specified usage are required.
|
protected boolean |
isWithTexts()
Asks if texts are required.
|
protected boolean |
isWithTexts(String lang)
Asks if texts in the specified language are required.
|
protected int |
nextId()
Returns the next ID for attribution to an Entity.
|
protected Optional<String> |
reference(Optional<? extends Entity> entity)
Returns a reference string to an entity.
|
protected void |
registerReference(Optional<? extends Entity> entity)
Registers an entity.
|
protected XMLExporter(@Nonnull Optional<ConfigExporter> owner)
owner
- The optional exporter owning this.@CheckReturnValue protected static boolean areDeferredSubstitutions(@Nonnull Object[] values)
values
- The values.protected final void addExporter(@Nonnull Class<? extends Entity> entityClass)
entityClass
- The Entity Class.@Nonnull @CheckReturnValue protected final XMLElement createElement(@Nonnull String name)
name
- The Element name.@Nonnull @CheckReturnValue protected Config getConfig()
@Nonnull @CheckReturnValue protected XMLDocument getDocument()
@Nonnull @CheckReturnValue protected abstract String getElementName()
@Nonnull @CheckReturnValue protected final Optional<? extends Entity> getEntity(@Nonnull String name, @Nonnull String prefix)
name
- The name of the entity.prefix
- The prefix associated with the class of the entity.@Nonnull @CheckReturnValue protected ConfigExporter getOwner()
@Nonnull @CheckReturnValue protected final EntityReference getReference(@Nonnull Entity entity)
entity
- The referenced Entity.@Nonnull @CheckReturnValue protected XMLElement getRootElement()
@CheckReturnValue protected final boolean isWithAttributes()
@CheckReturnValue protected final boolean isWithAttributes(@Nonnull String usage)
usage
- The attributes usage.@CheckReturnValue protected final boolean isWithTexts()
@CheckReturnValue protected final boolean isWithTexts(String lang)
lang
- The texts language.@CheckReturnValue protected int nextId()
@Nonnull @CheckReturnValue protected Optional<String> reference(@Nonnull Optional<? extends Entity> entity)
entity
- The optional entity.protected void registerReference(@Nonnull Optional<? extends Entity> entity)
entity
- The entity to register.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.