Package org.jitterbit.util.name

Examples of org.jitterbit.util.name.NameValidator


    public void addActionListener(ActionListener lst) {
        actionListeners.add(lst);
    }

    public void validateProjectName() throws IllegalNameException {
        NameValidator validator = NameValidatorStore.getInstance().get(IntegrationProject.class);
        validator.validateName(nameField.getValue());
    }
View Full Code Here


    private void checkName() throws IllegalNameException {
        String name = getName();
        if (!EntityUtils.isNameUnique(this, name)) {
            throw new IllegalNameException("The name \"" + name + "\" is already in use.");
        }
        NameValidator v = NameValidatorStore.getInstance().get(this);
        if (v != null) {
            v.validateName(name);
        }
    }
View Full Code Here

            firePropertyChange(PROPERTY_DESCRIPTION, old, desc);
        }
    }

    private static NameValidator getNameValidator(Nameable o) {
        NameValidator v = NameValidatorStore.getInstance().get(o);
        return (v == null) ? new DefaultNameValidator() : v;
    }
View Full Code Here

        return validateName() && validateLocation();
    }

    private boolean validateName() {
        try {
            NameValidator validator = NameValidatorStore.getInstance().get(IntegrationProject.class);
            validator.validateName(newName);
            return true;
        } catch (IllegalNameException ex) {
            Alert.error(ex.getMessage(), "Invalid Name");
            return false;
        }
View Full Code Here

    public String getInvalidMessage(String value) {
        return (lastException != null) ? lastException.getMessage() : super.getInvalidMessage(value);
    }

    public static NameValidator getDefaultNameValidator(final IntegrationEntity entity) {
        return new NameValidator() {

            @Override
            public void validateName(String name) throws IllegalNameException {
                NameValidator validator = NameValidatorStore.getInstance().get(entity);
                if (validator != null) {
                    validator.validateName(name);
                }
                if (!EntityUtils.isNameUnique(entity, name)) {
                    String msg = format("DuplicateName.Message", name);
                    throw new IllegalNameException(msg);
                }
View Full Code Here

        File newFolder = new File(originalLocation.getLocation().getParentFile(), newName);
        return new ProjectLocation(newName, newFolder);
    }
   
    private void validateName(String name) throws IllegalNameException {
        NameValidator validator = NameValidatorStore.getInstance().get(IntegrationProject.class);
        validator.validateName(name);
    }
View Full Code Here

            }
        }

        private boolean isNameOk(String name) {
            try {
                NameValidator validator = NameValidatorStore.getInstance().get(IntegrationProject.class);
                validator.validateName(name);
                return true;
            } catch (IllegalNameException ex) {
                handleError(ex);
                return false;
            }
View Full Code Here

     * @return a name that can be applied to <tt>entity</tt>.
     * @throws IllegalNameException
     *             if <tt>originalName</tt> is not a valid name.
     */
    public static String getAvailableName(IntegrationEntity entity, String originalName) throws IllegalNameException {
        NameValidator v = NameValidatorStore.getInstance().get(entity);
        if (v != null) {
            v.validateName(originalName);
        }
        String newName = originalName;
        int counter = 2;
        while (!EntityUtils.isNameUnique(entity, newName)) {
            newName = originalName + " (" + counter + ")";
View Full Code Here

     * @throws IllegalNameException
     *             if <tt>originalName</tt> is not a valid name.
     */
    public static String getAvailableName(IntegrationEntity entity, IntegrationEntity owner, String originalName)
                    throws IllegalNameException {
        NameValidator v = NameValidatorStore.getInstance().get(entity);
        if (v != null) {
            v.validateName(originalName);
        }
        String newName = originalName;
        int counter = 2;
        while (EntityUtils.isNameTaken(owner, newName)) {
            newName = originalName + " (" + counter + ")";
View Full Code Here

            this.owner = owner;
            defaultValidator = createImpl();
        }

        private NameValidator createImpl() {
            NameValidator impl = NameValidatorStore.getInstance().get(item.getClass());
            if (impl == null) {
                impl = NameValidatorStore.getInstance().get(IntegrationEntity.class);
            }
            return impl;
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.util.name.NameValidator

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.