public static NamespaceBlock create(final String resourceLocation,
            final Properties blockProperties)
            throws BELDataMissingPropertyException, BELDataConversionException {

        if (resourceLocation == null) {
            throw new InvalidArgument("resourceLocation", resourceLocation);
        }
        if (blockProperties == null) {
            throw new InvalidArgument("blockProperties", blockProperties);
        }

        // handle blank keyword
        String keyword = blockProperties.getProperty(PROPERTY_KEYWORD);
        if (StringUtils.isBlank(keyword)) {
            throw new BELDataMissingPropertyException(resourceLocation,
                    BLOCK_NAME, PROPERTY_KEYWORD);
        }

        // handle blank name
        String name = blockProperties.getProperty(PROPERTY_NAME);
        if (StringUtils.isBlank(name)) {
            throw new BELDataMissingPropertyException(resourceLocation,
                    BLOCK_NAME, PROPERTY_NAME);
        }

        // handle blank domain
        String domain = blockProperties.getProperty(PROPERTY_DOMAIN);
        if (StringUtils.isBlank(domain)) {
            throw new BELDataMissingPropertyException(resourceLocation,
                    BLOCK_NAME, PROPERTY_DOMAIN);
        }

        // handle blank created date time
        String createdDateTime =
                blockProperties.getProperty(PROPERTY_CREATED_DATE_TIME);
        if (StringUtils.isBlank(createdDateTime)) {
            throw new BELDataMissingPropertyException(resourceLocation,
                    BLOCK_NAME, PROPERTY_CREATED_DATE_TIME);
        }

        // retrieve optional properties
        String species = blockProperties.getProperty(PROPERTY_SPECIES);
        String description = blockProperties.getProperty(PROPERTY_DESCRIPTION);
        String version = blockProperties.getProperty(PROPERTY_VERSION);
        String queryValueURL =
                blockProperties.getProperty(PROPERTY_QUERY_VALUE_URL);

        // convert to proper type
        return new NamespaceBlock(
                typeConvert(resourceLocation, PROPERTY_KEYWORD, keyword,
                        String.class),
                typeConvert(resourceLocation, PROPERTY_NAME, name, String.class),
                typeConvert(resourceLocation, PROPERTY_DOMAIN, domain,
                        String.class),
                typeConvert(resourceLocation, PROPERTY_CREATED_DATE_TIME,
                        createdDateTime, Date.class),
                typeConvert(resourceLocation, PROPERTY_DESCRIPTION,
                        description, String.class),
                typeConvert(resourceLocation, PROPERTY_SPECIES, species,
                        String.class),
                typeConvert(resourceLocation, PROPERTY_VERSION, version,
                        String.class),
                typeConvert(resourceLocation, PROPERTY_QUERY_VALUE_URL,
                        queryValueURL, URL.class));
    }
public static NamespaceBlock create ( final String resourceLocation , final Properties blockProperties ) throws BELDataMissingPropertyException , BELDataConversionException { if ( resourceLocation == null ) { throw new InvalidArgument ( "resourceLocation" , resourceLocation ) ; } if ( blockProperties == null ) { throw new InvalidArgument ( "blockProperties" , blockProperties ) ; } String keyword = blockProperties . getProperty ( PROPERTY_KEYWORD ) ; if ( StringUtils . isBlank ( keyword ) ) { throw new BELDataMissingPropertyException ( resourceLocation , BLOCK_NAME , PROPERTY_KEYWORD ) ; } String name = blockProperties . getProperty ( PROPERTY_NAME ) ; if ( StringUtils . isBlank ( name ) ) { throw new BELDataMissingPropertyException ( resourceLocation , BLOCK_NAME , PROPERTY_NAME ) ; } String domain = blockProperties . getProperty ( PROPERTY_DOMAIN ) ; if ( StringUtils . isBlank ( domain ) ) { throw new BELDataMissingPropertyException ( resourceLocation , BLOCK_NAME , PROPERTY_DOMAIN ) ; } String createdDateTime = blockProperties . getProperty ( PROPERTY_CREATED_DATE_TIME ) ; if ( StringUtils . isBlank ( createdDateTime ) ) { throw new BELDataMissingPropertyException ( resourceLocation , BLOCK_NAME , PROPERTY_CREATED_DATE_TIME ) ; } String species = blockProperties . getProperty ( PROPERTY_SPECIES ) ; String description = blockProperties . getProperty ( PROPERTY_DESCRIPTION ) ; String version = blockProperties . getProperty ( PROPERTY_VERSION ) ; String queryValueURL = blockProperties . getProperty ( PROPERTY_QUERY_VALUE_URL ) ; return new NamespaceBlock ( typeConvert ( resourceLocation , PROPERTY_KEYWORD , keyword , String . class ) , typeConvert ( resourceLocation , PROPERTY_NAME , name , String . class ) , typeConvert ( resourceLocation , PROPERTY_DOMAIN , domain , String . class ) , typeConvert ( resourceLocation , PROPERTY_CREATED_DATE_TIME , createdDateTime , Date . class ) , typeConvert ( resourceLocation , PROPERTY_DESCRIPTION , description , String . class ) , typeConvert ( resourceLocation , PROPERTY_SPECIES , species , String . class ) , typeConvert ( resourceLocation , PROPERTY_VERSION , version , String . class ) , typeConvert ( resourceLocation , PROPERTY_QUERY_VALUE_URL , queryValueURL , URL . class ) ) ; }
Creates a new instance of {@link NamespaceBlock} using
{@link Properties block properties}.

@param resourceLocation the {@link String resource location} of the
namespace used for exception reporting; which cannot be {@code null}
@param blockProperties the {@link Properties block properties} to
populate the {@link NamespaceBlock namespace block} with, which
cannot be {@code null}
@return a new {@link NamespaceBlock namespace block} instance, which
will not be {@code null}
@throws BELDataMissingPropertyException Thrown if a property was
required but not provided
@throws BELDataConversionException Thrown if a property value could not
be converted to the right type
@throws InvalidArgument Thrown if {@code ResourceLocation} or
{@code blockProperties} is {@code null}