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

com.anrisoftware.globalpom.reflection.annotationclass.AnnotationClassLogger Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2014-2025 Erwin Müller 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.anrisoftware.globalpom.reflection.annotationclass;

/*-
 * #%L
 * Global POM Utilities :: Reflection
 * %%
 * Copyright (C) 2014 - 2018 Advanced Natural Research Institute
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import static org.apache.commons.lang3.Validate.notBlank;

import jakarta.inject.Singleton;

import com.anrisoftware.globalpom.log.AbstractLogger;

/**
 * Logging messages for {@link AnnotationClass}.
 * 
 * @author Erwin Mueller, [email protected]
 * @since 1.5
 */
@Singleton
class AnnotationClassLogger extends AbstractLogger {

	private static final String ONE_CLASS_TYPES = "More then one class types are specified for attribute '{}'.";
	private static final String NAME_NULL = "Attribute name can not be null or empty.";

	/**
	 * Create logger for {@link AnnotationClass}.
	 */
	public AnnotationClassLogger() {
		super(AnnotationClass.class);
	}

	void checkAttributeName(String name) {
		notBlank(name, NAME_NULL);
	}

	void checkClassAttribute(Class[] type, String name) {
		if (type.length > 1) {
			log.warn(ONE_CLASS_TYPES, name);
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy