Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
/*
* This file is a part of MDClasses.
*
* Copyright © 2019 - 2020
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* MDClasses is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* MDClasses is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MDClasses.
*/
package com.github._1c_syntax.mdclasses.metadata.additional;

import com.github._1c_syntax.mdclasses.mdo.MDObjectBSL;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Value;

import java.net.URI;

/**
* Класс-описание модуля объекта
*/
@Value
@EqualsAndHashCode(exclude = {"owner"})
@AllArgsConstructor
public class MDOModule {

/**
* Тип модуля
*/
ModuleType moduleType;

/**
* Ссылка на файл bsl модуля
*/
URI uri;

/**
* Ссылка на объект метаданных которому принадлежит модуль
*/
MDObjectBSL owner;
}
/*
* This file is a part of MDClasses.
*
* Copyright © 2019 - 2020
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* MDClasses is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* MDClasses is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MDClasses.
*/
package com.github._1c_syntax.mdclasses.metadata.additional;

import com.github._1c_syntax.mdclasses.mdo.MDObjectBSL;
import com.github._1c_syntax.mdclasses.metadata.additional.ModuleType;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Value;

import java.net.URI;

/**
* Класс-описание модуля объекта
*/
@Value
@EqualsAndHashCode(exclude = {"owner"})
@AllArgsConstructor
public class MDOModule {

/**
* Тип модуля
*/
ModuleType moduleType;

/**
* Ссылка на файл bsl модуля
*/
URI uri;

/**
* Ссылка на объект метаданных которому принадлежит модуль
*/
MDObjectBSL owner;
}
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
/*
* This file is a part of MDClasses.
*
* Copyright © 2019 - 2020
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* MDClasses is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* MDClasses is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MDClasses.
*/
package com.github._1c_syntax.mdclasses.metadata.additional;

import com.github._1c_syntax.mdclasses.mdo.MDOAttribute;
import com.github._1c_syntax.mdclasses.mdo.MDObjectBase;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
* Класс-ссылка на объект в формате ВидОбъектаМетаданных.ИмяОбъекта
*/
@Data
@EqualsAndHashCode(of = {"mdoRef"})
@ToString(of = {"mdoRef"})
public class MDOReference {

/**
* Тип объекта метаданных
*/
private MDOType type;

/**
* Строковое представление ссылки
*/
private String mdoRef;

public MDOReference(MDObjectBase mdo) {
type = mdo.getType();
mdoRef = getType().getName() + "." + mdo.getName();
}

/**
* Создает ссылку для дочерних объектов
*
* @param mdo - Объект метаданных
* @param parent - Родительский объект
*/
public MDOReference(MDObjectBase mdo, MDObjectBase parent) {
this(mdo);
if (mdo instanceof MDOAttribute) {
mdoRef = ((MDOAttribute) mdo).getAttributeType().getClassName() + "." + mdo.getName();
}

if (parent.getMdoReference() != null) {
mdoRef = parent.getMdoReference().getMdoRef() + "." + mdoRef;
}
}
}
/*
* This file is a part of MDClasses.
*
* Copyright © 2019 - 2020
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* MDClasses is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* MDClasses is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MDClasses.
*/
package com.github._1c_syntax.mdclasses.metadata.additional;

import com.github._1c_syntax.mdclasses.mdo.MDOAttribute;
import com.github._1c_syntax.mdclasses.mdo.MDObjectBase;
import com.github._1c_syntax.mdclasses.metadata.additional.MDOType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
* Класс-ссылка на объект в формате ВидОбъектаМетаданных.ИмяОбъекта
*/
@Data
@EqualsAndHashCode(of = {"mdoRef"})
@ToString(of = {"mdoRef"})
public class MDOReference {

/**
* Тип объекта метаданных
*/
private MDOType type;

/**
* Строковое представление ссылки
*/
private String mdoRef;

public MDOReference(MDObjectBase mdo) {
type = mdo.getType();
mdoRef = getType().getName() + "." + mdo.getName();
}

/**
* Создает ссылку для дочерних объектов
*
* @param mdo - Объект метаданных
* @param parent - Родительский объект
*/
public MDOReference(MDObjectBase mdo, MDObjectBase parent) {
this(mdo);
if (mdo instanceof MDOAttribute) {
mdoRef = ((MDOAttribute) mdo).getAttributeType().getClassName() + "." + mdo.getName();
}

if (parent.getMdoReference() != null) {
mdoRef = parent.getMdoReference().getMdoRef() + "." + mdoRef;
}
}
}
Loading