001/* 002 * Copyright 2026 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.runtime.model; 017 018/** 019 * Object that gives some context for view parsing 020 * There is no context elements needed here. This class can be overridden to add some specific context elements 021 */ 022public class ViewParserContext 023{ 024 /** 025 * Creates a new instance of a {@link ViewParserContext} 026 */ 027 protected ViewParserContext() 028 { 029 // Empty private constructor 030 } 031 032 /** 033 * Creates a new instance of a {@link ViewParserContext} from another {@link ViewParserContext} 034 * @param context the view parser context to copy 035 */ 036 protected ViewParserContext(ViewParserContext context) 037 { 038 // Empty copy constructor 039 } 040 041 /** 042 * Creates a new instance of a {@link ViewParserContext} 043 * @return the created instance 044 */ 045 public static ViewParserContext newInstance() 046 { 047 return new ViewParserContext(); 048 } 049 050 /** 051 * Creates a new instance of a {@link ViewParserContext} from another {@link ViewParserContext}. 052 * It can be the same implementation or another one, but it will be casted to the current implementation. 053 * @param context the data context to copy 054 * @return the created instance 055 */ 056 public static ViewParserContext newInstance(ViewParserContext context) 057 { 058 return new ViewParserContext(context); 059 } 060}