Package org.apache.hivemind.util

Examples of org.apache.hivemind.util.LocalizedNameGenerator


    private List findLocalizations(Locale locale)
    {
        List result = new ArrayList();

        LocalizedNameGenerator g = new LocalizedNameGenerator(_baseName, locale, EXTENSION);

        while (g.more())
        {
            String name = g.next();

            Localization l = new Localization(g.getCurrentLocale(), _baseResource
                    .getRelativeResource(name));

            result.add(l);
        }
View Full Code Here


    private List findLocalizations(Locale locale)
    {
        List result = new ArrayList();

        LocalizedNameGenerator g = new LocalizedNameGenerator(_baseName, locale, EXTENSION);

        while (g.more())
        {
            String name = g.next();

            Localization l = new Localization(g.getCurrentLocale(), _baseResource
                    .getRelativeResource(name));

            result.add(l);
        }
View Full Code Here

        String descriptorName = moduleLocation.getName();
        int dotx = descriptorName.lastIndexOf('.');
        String baseName = descriptorName.substring(0, dotx);

        LocalizedNameGenerator g = new LocalizedNameGenerator(baseName, _locale, ".properties");
        List urls = new ArrayList();

        while (g.more())
        {
            String name = g.next();
            Resource l = moduleLocation.getRelativeResource(name);
            URL url = l.getResourceURL();

            if (url != null)
                urls.add(url);
View Full Code Here

            // Resource without extension
            basePath = contextPath;
            suffix = "";
        }

        LocalizedNameGenerator generator = new LocalizedNameGenerator(basePath,
                locale, suffix);

        while(generator.more())
        {
            String candidatePath = generator.next();

            if (isExistingResource(candidatePath))
                return new LocalizedResource(candidatePath, generator
                        .getCurrentLocale());
        }

        return null;
    }
View Full Code Here

    {
        int dotx = contextPath.lastIndexOf('.');
        String basePath = contextPath.substring(0, dotx);
        String suffix = contextPath.substring(dotx);

        LocalizedNameGenerator generator = new LocalizedNameGenerator(basePath, locale, suffix);

        while (generator.more())
        {
            String candidatePath = generator.next();

            if (isExistingResource(candidatePath))
                return new LocalizedResource(candidatePath, generator.getCurrentLocale());
        }

        return null;
    }
View Full Code Here

    {
        List result = new ArrayList();

        String baseName = extractBaseName(resource);

        LocalizedNameGenerator g = new LocalizedNameGenerator(baseName, locale,
                SUFFIX);

        while(g.more())
        {
            String localizedName = g.next();
            Locale l = g.getCurrentLocale();
            Resource localizedResource = resource
                    .getRelativeResource(localizedName);

            result.add(new ResourceLocalization(l, localizedResource));
        }
View Full Code Here

    public String getPropertyValue(String propertyName, Locale locale)
    {
        Defense.notNull(propertyName, "propertyName");

        LocalizedNameGenerator g = new LocalizedNameGenerator(propertyName, locale, "");

        while (g.more())
        {
            String localizedName = g.next();

            String result = _source.getPropertyValue(localizedName);

            if (result != null)
                return result;
View Full Code Here

    {
        List result = new ArrayList();

        String baseName = extractBaseName(resource);

        LocalizedNameGenerator g = new LocalizedNameGenerator(baseName, locale, SUFFIX);

        while (g.more())
        {
            String localizedName = g.next();
            Locale l = g.getCurrentLocale();
            Resource localizedResource = resource.getRelativeResource(localizedName);

            result.add(new ResourceLocalization(l, localizedResource));
        }
View Full Code Here

     *  of more specific to more general and returns the first that has a value.
     *  @see org.apache.tapestry.util.DelegatingPropertySource#getPropertyValue(java.lang.String)
     */
    public String getPropertyValue(String propertyName)
    {
        LocalizedNameGenerator generator = new LocalizedNameGenerator(propertyName, getLocale(), "");

        while (generator.more())
        {
            String candidateName = generator.next();

            String value = super.getPropertyValue(candidateName);
            if (value != null)
                return value;
        }
View Full Code Here

    public String getPropertyValue(String propertyName, Locale locale)
    {
        Defense.notNull(propertyName, "propertyName");

        LocalizedNameGenerator g = new LocalizedNameGenerator(propertyName, locale, "");

        while (g.more())
        {
            String localizedName = g.next();

            String result = _source.getPropertyValue(localizedName);

            if (result != null)
                return result;
View Full Code Here

TOP

Related Classes of org.apache.hivemind.util.LocalizedNameGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.