001 package railo.runtime.ext.tag; 002 003 import java.util.ArrayList; 004 import java.util.List; 005 006 public class TagMetaDataImpl implements TagMetaData { 007 008 private int attrMin; 009 private int attrMax; 010 private int attrType; 011 private List attrs=new ArrayList(); 012 private int bodyContent; 013 private String description; 014 private boolean isBodyRE; 015 private boolean handleException; 016 private boolean hasAppendix; 017 private boolean hasBody; 018 019 020 021 /** 022 * Constructor of the class 023 * @param attrType TagMetaData.ATTRIBUTE_TYPE_FIX,TagMetaData.ATTRIBUTE_TYPE_DYNAMIC,TagMetaData.ATTRIBUTE_TYPE_MIXED 024 * @param attrMin minimal count of attributes needed for tag 025 * @param attrMax maximal count of attributes or -1 for infinity attributes 026 * @param bodyContent TagMetaData.BODY_CONTENT_EMPTY,TagMetaData.BODY_CONTENT_FREE,TagMetaData.BODY_CONTENT_MUST 027 * @param isBodyRE is the body of the tag parsed like inside a cfoutput 028 * @param description A description of the tag. 029 */ 030 public TagMetaDataImpl(int attrType, int attrMin, int attrMax, int bodyContent, boolean isBodyRE, String description, 031 boolean handleException, boolean hasAppendix, boolean hasBody) { 032 this.attrMax = attrMax; 033 this.attrMin = attrMin; 034 this.attrType = attrType; 035 this.description = description; 036 this.isBodyRE = isBodyRE; 037 this.handleException = handleException; 038 this.hasAppendix = hasAppendix; 039 this.hasBody = hasBody; 040 } 041 042 /** 043 * @see railo.runtime.ext.tag.TagMetaData#getAttributeMax() 044 */ 045 public int getAttributeMax() { 046 return attrMax; 047 } 048 049 /** 050 * @see railo.runtime.ext.tag.TagMetaData#getAttributeMin() 051 */ 052 public int getAttributeMin() { 053 return attrMin; 054 } 055 056 /** 057 * @see railo.runtime.ext.tag.TagMetaData#getAttributeType() 058 */ 059 public int getAttributeType() { 060 return attrType; 061 } 062 063 /** 064 * @see railo.runtime.ext.tag.TagMetaData#getAttributes() 065 */ 066 public TagMetaDataAttr[] getAttributes() { 067 return (TagMetaDataAttr[]) attrs.toArray(new TagMetaDataAttr[attrs.size()]); 068 } 069 070 /** 071 * adds a attribute to the tag 072 * @param attr 073 */ 074 public void addAttribute(TagMetaDataAttr attr) { 075 attrs.add(attr); 076 } 077 078 /** 079 * @see railo.runtime.ext.tag.TagMetaData#getBodyContent() 080 */ 081 public int getBodyContent() { 082 return bodyContent; 083 } 084 085 /** 086 * @see railo.runtime.ext.tag.TagMetaData#getDescription() 087 */ 088 public String getDescription() { 089 return description; 090 } 091 092 /** 093 * @see railo.runtime.ext.tag.TagMetaData#isBodyRuntimeExpressionValue() 094 */ 095 public boolean isBodyRuntimeExpressionValue() { 096 return isBodyRE; 097 } 098 099 /** 100 * @see railo.runtime.ext.tag.TagMetaData#handleException() 101 */ 102 public boolean handleException() { 103 return handleException; 104 } 105 106 /** 107 * @see railo.runtime.ext.tag.TagMetaData#hasAppendix() 108 */ 109 public boolean hasAppendix() { 110 return hasAppendix; 111 } 112 113 /** 114 * @see railo.runtime.ext.tag.TagMetaData#hasBody() 115 */ 116 public boolean hasBody() { 117 return hasBody; 118 } 119 120 }