All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.app.ApplicationWildcardResolver Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.app;

@Deprecated
public class ApplicationWildcardResolver
{
    public static final String APP_WILDCARD = "${app}";

    public static final String ANY_WILDCARD = "*";

    public boolean stringHasWildcard( final String contentTypeName )
    {
        return this.hasAnyWildcard( contentTypeName ) || this.startWithAppWildcard( contentTypeName );
    }

    public boolean startWithAppWildcard( String s )
    {
        return s.startsWith( APP_WILDCARD );
    }

    public boolean hasAnyWildcard( String s )
    {
        return s.contains( ANY_WILDCARD );
    }

    public String resolveAppWildcard( final String nameToResolve, final ApplicationKey applicationKey )
    {
        return nameToResolve.replace( APP_WILDCARD, applicationKey.toString() );
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy