public String basePackageName() {
        try {
            return Optional.of(document())
                .map(HasPackageName.class::cast)
                .flatMap(HasPackageName::getPackageName)
                .orElseGet(this::defaultPackageName);
        } catch (final ClassCastException ex) {
            throw new SpeedmentException(
                "The method basePackageName() may only be called on " +
                "instances of TranslatorSupport that have a document that " +
                "implements HasPackageName.",
                ex
            );
        }
    }
Returns the base package name of the current node. This is everything up
to but not including the type name. No trailing dot is added.
<p>
If the user has specified a custom package in the config file, that will
be returned. Otherwise a package name will ge generated using the default
settings.

@return  the base package name in lowercase
generator-parent/generator-translator/src/main/java/com/speedment/generator/translator/TranslatorSupport.java