001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.ext.tag; 020 021 022public interface TagMetaData { 023 024 025 /** 026 * Body is not allowed for this tag 027 */ 028 public int BODY_CONTENT_EMPTY=0; 029 030 /** 031 * tag can have a body, but it is not required 032 */ 033 public int BODY_CONTENT_FREE=1; 034 035 /** 036 * body is required for this tag 037 */ 038 public int BODY_CONTENT_MUST=2; 039 040 /** 041 * tag has a fix defined group of attributes, only this attributes are allowed 042 */ 043 public int ATTRIBUTE_TYPE_FIX=4; 044 045 /** 046 * there is no restriction or rules for attributes, tag can have as many as whished 047 */ 048 public int ATTRIBUTE_TYPE_DYNAMIC=8; 049 050 /** 051 * tag has a fix set of attributes, but is also free in use additional tags 052 */ 053 public int ATTRIBUTE_TYPE_MIXED=16; 054 055 056 /** 057 * type of the body content 058 * @return TagMetaData.BODY_CONTENT_EMPTY,TagMetaData.BODY_CONTENT_FREE,TagMetaData.BODY_CONTENT_MUST 059 */ 060 public int getBodyContent(); 061 062 /** 063 * attribute type 064 * @return TagMetaData.ATTRIBUTE_TYPE_FIX,TagMetaData.ATTRIBUTE_TYPE_DYNAMIC,TagMetaData.ATTRIBUTE_TYPE_MIXED 065 */ 066 public int getAttributeType(); 067 068 /** 069 * minimal count of attributes needed for tag 070 * @return minimal count of attributes 071 */ 072 public int getAttributeMin(); 073 /** 074 * maximum count of attributes needed for tag 075 * @return maximum count of attributes or -1 for infinity attributes 076 */ 077 public int getAttributeMax(); 078 079 080 /** 081 * is the body of the tag parsed like inside a cfoutput 082 * @return parsed or not 083 */ 084 public boolean isBodyRuntimeExpressionValue(); 085 086 /** 087 * A description of the tag. 088 * @return description of the tag 089 */ 090 public String getDescription(); 091 092 /** 093 * fix attributes of the tag 094 */ 095 public TagMetaDataAttr[] getAttributes(); 096 097 /** 098 * has the tag a body 099 * @return has a body 100 */ 101 public boolean hasBody(); 102 103 /** 104 * can the tag handle exceptons 105 * @return can handle exceptions 106 */ 107 public boolean handleException(); 108 109 /** 110 * has the tag a appendix 111 * @return has appendix 112 */ 113 public boolean hasAppendix(); 114 115 116}