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

com.igormaznitsa.mindmap.annotations.MmdFile Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2015-2022 Igor A. Maznitsa
 *
 * 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.igormaznitsa.mindmap.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation allows provide information about target MMD file to collect data.
 *
 * @see MmdFiles
 */
@Repeatable(MmdFiles.class)
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
public @interface MmdFile {
  /**
   * Owner class folder.
   */
  String MACROS_SRC_CLASS_FOLDER = "${mmd.src.class.folder}";

  /**
   * File UID, it should be used in another MMD annotations to mark them as belonged to the file.
   *
   * @return file UID, if empty then will be autogenerated
   * @see MmdTopic#fileUid()
   */
  String uid() default "";

  /**
   * Folder to generate the file.
   */
  String folder() default MACROS_SRC_CLASS_FOLDER;

  /**
   * File name, may include path part.
   *
   * @return file name, if empty then will use a class name based autogenerated one.
   * @see #folder()
   */
  String fileName() default "";

  /**
   * Root topic for the file.
   *
   * @return the root topic parameters for the file.
   */
  MmdTopic rootTopic() default @MmdTopic;

  /**
   * Flag to make substitution for found {@code ${variable.name}} in all text based fields.
   * Supported variables depends on preprocessor, the standard one provides system properties as variables. If detected unknown variable then exception will be thrown.
   *
   * @return true if text fields should be substituted
   * @since 1.6.8
   * {@code  @MmdFile(substitute=true, fileName="${os.name}-someFile")}
   */
  boolean substitute() default false;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy