@Override public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException { for (ReturnAttribute returnAttribute : returnAttributes) { String returnAttributeName = returnAttribute.name(); //Check if the @ReturnAttributes name is empty. if (returnAttributeName.isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name annotated in class {0} is null or empty.", extensionClassFullName)); } else if (!CAMEL_CASE_PATTERN.matcher(returnAttributeName).find()) { //Check if the @Extension -> @ReturnAttribute -> name is in a correct camelCase // format using regex pattern. throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name {0} annotated in class {1} is not in camelCase format.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes description is empty. if (returnAttribute.description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes type is empty. if (returnAttribute.type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> type annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } } } }
namespace = "time", description = "This function returns the system time in 'yyyy-MM-dd' format.", returnAttributes = @ReturnAttribute( description = "The value returned is of 'string' type.", type = {DataType.STRING}),
namespace = "time", description = "This function returns the system time in 'yyyy-MM-dd HH:mm:ss' format.", returnAttributes = @ReturnAttribute( description = "The system time that is returned in 'yyyy-MM-dd HH:mm:ss' format.", type = {DataType.STRING}),
namespace = "time", description = "This function returns system time in the 'HH:mm:ss' format.", returnAttributes = @ReturnAttribute( description = "The parameter returned is of 'string' type.", type = {DataType.STRING}),
@Override public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException { for (ReturnAttribute returnAttribute : returnAttributes) { String returnAttributeName = returnAttribute.name(); //Check if the @ReturnAttributes name is empty. if (returnAttributeName.isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name annotated in class {0} is null or empty.", extensionClassFullName)); } else if (!CAMEL_CASE_PATTERN.matcher(returnAttributeName).find()) { //Check if the @Extension -> @ReturnAttribute -> name is in a correct camelCase // format using regex pattern. throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name {0} annotated in class {1} is not in camelCase format.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes description is empty. if (returnAttribute.description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes type is empty. if (returnAttribute.type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> type annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } } } }
namespace = "time", description = "This function returns the system time in 'yyyy-MM-dd HH:mm:ss' format.", returnAttributes = @ReturnAttribute( description = "The value returned is of 'string' type.", type = {DataType.STRING}),
String returnAttributeName = returnAttribute.name(); if (returnAttribute.description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", if (returnAttribute.type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> type annotated in class {1} is null or empty.",
description = "The value that needs to be converted from seconds into microseconds.", type = {DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE}), returnAttributes = @ReturnAttribute( description = "The value that is returned in microseconds.", type = {DataType.DOUBLE}),
"@ReturnAttribute annotated in class {0} is null or empty.", extensionClassFullName)); } else if (returnAttributes.length == 1) { String returnAttributeName = returnAttributes[0].name(); if (returnAttributes[0].description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", if (returnAttributes[0].type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension ->" + " @ReturnAttribute -> name{0} -> type annotated in class {1} is null or empty.",
description = "The value that needs to be converted from kilograms into grams.", type = {DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE}), returnAttributes = @ReturnAttribute( description = "The value that is returned in grams.", type = {DataType.DOUBLE}),
"@ReturnAttribute annotated in class {0} is null or empty.", extensionClassFullName)); } else if (returnAttributes.length == 1) { String returnAttributeName = returnAttributes[0].name(); if (returnAttributes[0].description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", if (returnAttributes[0].type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension ->" + " @ReturnAttribute -> name{0} -> type annotated in class {1} is null or empty.",
description = "The value that needs to be converted from centimeters into inches.", type = {DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE}), returnAttributes = @ReturnAttribute( description = "The value that is returned in inches.", type = {DataType.DOUBLE}),
"annotated in class {0} is null or empty.", extensionClassFullName)); } else if (returnAttributes.length == 1) { String returnAttributeName = returnAttributes[0].name(); if (returnAttributes[0].description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", if (returnAttributes[0].type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name{0} -> type annotated in class {1} is null or empty.",
description = "The value that needs to be converted from kilometers into nanometers.", type = {DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE}), returnAttributes = @ReturnAttribute( description = "The value that is returned in nanometers.", type = {DataType.DOUBLE}),
@Override public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException { for (ReturnAttribute returnAttribute : returnAttributes) { String returnAttributeName = returnAttribute.name(); //Check if the @ReturnAttributes name is empty. if (returnAttributeName.isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name annotated in class {0} is null or empty.", extensionClassFullName)); } else if (!CAMEL_CASE_PATTERN.matcher(returnAttributeName).find()) { //Check if the @Extension -> @ReturnAttribute -> name is in a correct camelCase // format using regex pattern. throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name {0} annotated in class {1} is not in camelCase format.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes description is empty. if (returnAttribute.description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes type is empty. if (returnAttribute.type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> type annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } } } }
description = "The value that needs to be converted from meters into centimeters.", type = {DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE}), returnAttributes = @ReturnAttribute( description = "The value that is returned in centimeters.", type = {DataType.DOUBLE}),
@Override public void returnAttributesValidation(ReturnAttribute[] returnAttributes) throws AnnotationValidationException { for (ReturnAttribute returnAttribute : returnAttributes) { String returnAttributeName = returnAttribute.name(); //Check if the @ReturnAttributes name is empty. if (returnAttributeName.isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name annotated in class {0} is null or empty.", extensionClassFullName)); } else if (!CAMEL_CASE_PATTERN.matcher(returnAttributeName).find()) { //Check if the @Extension -> @ReturnAttribute -> name is in a correct camelCase // format using regex pattern. throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name {0} annotated in class {1} is not in camelCase format.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes description is empty. if (returnAttribute.description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } //Check if the @ReturnAttributes type is empty. if (returnAttribute.type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> type annotated in class {1} is null or empty.", returnAttributeName, extensionClassFullName)); } } } }
description = "The value that needs to be converted from kilometers into inches.", type = {DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE}), returnAttributes = @ReturnAttribute( description = "The value that is returned in inches.", type = {DataType.DOUBLE}),
String returnAttributeName = returnAttribute.name(); if (returnAttribute.description().isEmpty()) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> description annotated in class {1} is null or empty.", if (returnAttribute.type().length == 0) { throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " + "@ReturnAttribute -> name:{0} -> type annotated in class {1} is null or empty.",
description = "The value that needs to be converted from kilograms into US tons.", type = {DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE}), returnAttributes = @ReturnAttribute( description = "The value that is returned in US tons.", type = {DataType.DOUBLE}),