Implicit getters and setters not made for me

I started playing with the new cfproperty material added in ColdFusion 9, but the main part that I want to use now does not work in ColdFusion 10. I created the following CFC:

component displayName="Sources" { /** * @getter true * @setter true * @type numeric * @default 1 **/ property sourceid; /** * @getter true * @setter true * @type numeric * @default 1 **/ property sourcegroup; public any function init () { This.domainRegex = '\/\/(www\.)?(([A-Za-z0-9\-_]+\.?)+)'; return this; } } 

When I delete the metadata for CFC, I can see the properties, but no methods have been created for them, and I can not call getSourceId() or getSourceGroup()

+6
source share
2 answers

try the following:

 component accessors="true" displayName="Sources" { property name="sourceid" type="numeric" default="1"; property name="sourcegroup" type="numeric" default="1"; public any function init () { this.domainRegex = '\/\/(www\.)?(([A-Za-z0-9\-_]+\.?)+)'; return this; } } 
+10
source

Try to remove the second asterisk in the close comment, for CF examples there is only one.

Alternatively, use a different syntax:

 property name="sourceid" type="numeric" default="1"; 

I'm not a fan of annotations in the comments on something else JavaDoc, it just doesn't feel anyway.

0
source

Source: https://habr.com/ru/post/922046/


All Articles