Skip to content

Commit cd4eef1

Browse files
authored
Fix javadoc generated for attribute setters (#1428)
Signed-off-by: Chris Jackson <[email protected]>
1 parent e3c225f commit cd4eef1

35 files changed

+719
-712
lines changed

com.zsmartsystems.zigbee.autocode/src/main/java/com/zsmartsystems/zigbee/autocode/ZigBeeBaseClassGenerator.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,10 @@ protected void outputClassGenerated(PrintStream out) {
346346

347347
protected void outputAttributeJavaDoc(PrintStream out, String type, ZigBeeXmlAttribute attribute,
348348
DataTypeMap zclDataType) {
349+
String name = attribute.name.replaceAll("\\{\\{count\\}\\}", "");
349350
out.println();
350351
out.println(" /**");
351-
out.println(" * " + type + " the <i>" + attribute.name + "</i> attribute [attribute ID <b>0x"
352+
out.println(" * " + type + " the <i>" + name + "</i> attribute [attribute ID <b>0x"
352353
+ String.format("%04X", attribute.code) + "</b>].");
353354
if (attribute.description.size() != 0) {
354355
out.println(" * <p>");
@@ -384,7 +385,7 @@ protected void outputAttributeJavaDoc(PrintStream out, String type, ZigBeeXmlAtt
384385
out.println(" * @param reportableChange {@link Object} delta required to trigger report");
385386
}
386387
} else if ("Set".equals(type)) {
387-
out.println(" * @param " + stringToLowerCamelCase(attribute.name) + " the {@link "
388+
out.println(" * @param " + stringToLowerCamelCase(name) + " the {@link "
388389
+ getDataTypeClass(attribute) + "} attribute value to be set");
389390
}
390391

com.zsmartsystems.zigbee.autocode/src/main/java/com/zsmartsystems/zigbee/autocode/ZigBeeZclClusterGenerator.java

+12-7
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,22 @@ private void generateZclClusterClasses(ZigBeeXmlCluster cluster, String packageR
300300
outputAttributeJavaDoc(out, "Set", attribute, zclDataType);
301301
out.println(" @Deprecated");
302302
if (attribute.arrayStart != null && attribute.arrayCount != null && attribute.arrayCount > 0) {
303-
String name = attribute.name.replaceAll("\\{\\{count\\}\\}", "");
304-
out.println(" public Future<CommandResult> set" + stringToUpperCamelCase(name).replace("_", "")
305-
+ "(final int arrayOffset, final " + getDataTypeClass(attribute) + " value) {");
306-
name = attribute.name.replaceAll("\\{\\{count\\}\\}", Integer.toString(attribute.arrayStart));
303+
String baseName = attribute.name.replaceAll("\\{\\{count\\}\\}", "");
307304
out.println(
308-
" return write(serverAttributes.get(" + getEnum(name) + " + arrayOffset), value);");
305+
" public Future<CommandResult> set" + stringToUpperCamelCase(baseName).replace("_", "")
306+
+ "(final int arrayOffset, final " + getDataTypeClass(attribute) + " "
307+
+ stringToLowerCamelCase(baseName) + ") {");
308+
String name = attribute.name.replaceAll("\\{\\{count\\}\\}",
309+
Integer.toString(attribute.arrayStart));
310+
out.println(
311+
" return write(serverAttributes.get(" + getEnum(name) + " + arrayOffset), "
312+
+ stringToLowerCamelCase(baseName) + ");");
309313
} else {
310314
out.println(" public Future<CommandResult> set"
311315
+ stringToUpperCamelCase(attribute.name).replace("_", "") + "(final "
312-
+ getDataTypeClass(attribute) + " value) {");
313-
out.println(" return write(serverAttributes.get(" + getEnum(attribute.name) + "), value);");
316+
+ getDataTypeClass(attribute) + " " + stringToLowerCamelCase(attribute.name) + ") {");
317+
out.println(" return write(serverAttributes.get(" + getEnum(attribute.name) + "), "
318+
+ stringToLowerCamelCase(attribute.name) + ");");
314319
}
315320
out.println(" }");
316321
}

com.zsmartsystems.zigbee.dongle.xbee/src/main/java/com/zsmartsystems/zigbee/dongle/xbee/internal/XBeeFrameHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public XBeeResponse sendRequest(final XBeeCommand command) {
586586
}
587587

588588
/**
589-
* Waits for a reponse of the requested class
589+
* Waits for a response of the requested class
590590
*
591591
* @param eventClass the class to wait for
592592
* @return response {@link Future} {@link XBeeCommand}

com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/app/discovery/ZigBeeNetworkDiscoverer.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,16 @@ private boolean getIeeeAddress(final int networkAddress) throws InterruptedExcep
381381
* @throws InterruptedException
382382
*/
383383
private boolean getAssociatedNodes(final int networkAddress) throws InterruptedException, ExecutionException {
384-
Integer startIndex = 0;
384+
int startIndex = 0;
385385
int totalAssociatedDevices = 0;
386386
Set<Integer> associatedDevices = new HashSet<>();
387387

388388
do {
389389
// Request extended response, start index for associated list is 0
390390
final IeeeAddressRequest ieeeAddressRequest = new IeeeAddressRequest(networkAddress, 1, startIndex);
391391
ieeeAddressRequest.setDestinationAddress(new ZigBeeEndpointAddress(networkAddress));
392-
final Future<CommandResult> resultFuture = networkManager.sendTransaction(ieeeAddressRequest, ieeeAddressRequest);
392+
final Future<CommandResult> resultFuture = networkManager.sendTransaction(ieeeAddressRequest,
393+
ieeeAddressRequest);
393394
if (resultFuture == null) {
394395
return false;
395396
}
@@ -402,7 +403,7 @@ private boolean getAssociatedNodes(final int networkAddress) throws InterruptedE
402403
logger.debug("NWK Discovery for {} IeeeAddressRequest returned {}", String.format("%04X", networkAddress),
403404
ieeeAddressResponse);
404405
if (ieeeAddressResponse != null && ieeeAddressResponse.getStatus() == ZdoStatus.SUCCESS
405-
&& startIndex.equals(ieeeAddressResponse.getStartIndex())) {
406+
&& startIndex == ieeeAddressResponse.getStartIndex()) {
406407
associatedDevices.addAll(ieeeAddressResponse.getNwkAddrAssocDevList());
407408

408409
startIndex += ieeeAddressResponse.getNwkAddrAssocDevList().size();

com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/app/seclient/ZclKeyEstablishmentServer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void shutdown() {
162162
*/
163163
public boolean setCryptoSuite(ZigBeeCryptoSuites requestedCryptoSuite) {
164164
if (cbkeProvider == null || !cbkeProvider.getAvailableCryptoSuites().contains(requestedCryptoSuite)) {
165-
logger.debug("{}: CBKE Key Establishment Server: Failed to set crypto suite to unsupported value {}",
165+
logger.debug("{}: CBKE Key Establishment Server: Failed to set crypto suite to unsupported value {} {}",
166166
ieeeAddress, requestedCryptoSuite,
167167
cbkeProvider == null ? "[]" : cbkeProvider.getAvailableCryptoSuites());
168168
return false;

com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclAnalogInputBasicCluster.java

+21-21
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* <p>
2929
* Code is auto-generated. Modifications may be overwritten!
3030
*/
31-
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2022-05-28T21:15:34Z")
31+
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2024-05-18T20:27:57Z")
3232
public class ZclAnalogInputBasicCluster extends ZclCluster {
3333
/**
3434
* The ZigBee Cluster Library Cluster ID
@@ -206,8 +206,8 @@ public ZclAnalogInputBasicCluster(final ZigBeeEndpoint zigbeeEndpoint) {
206206
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
207207
*/
208208
@Deprecated
209-
public Future<CommandResult> setDescription(final String value) {
210-
return write(serverAttributes.get(ATTR_DESCRIPTION), value);
209+
public Future<CommandResult> setDescription(final String description) {
210+
return write(serverAttributes.get(ATTR_DESCRIPTION), description);
211211
}
212212

213213
/**
@@ -279,8 +279,8 @@ public String getDescription(final long refreshPeriod) {
279279
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
280280
*/
281281
@Deprecated
282-
public Future<CommandResult> setMaxPresentValue(final Double value) {
283-
return write(serverAttributes.get(ATTR_MAXPRESENTVALUE), value);
282+
public Future<CommandResult> setMaxPresentValue(final Double maxPresentValue) {
283+
return write(serverAttributes.get(ATTR_MAXPRESENTVALUE), maxPresentValue);
284284
}
285285

286286
/**
@@ -352,8 +352,8 @@ public Double getMaxPresentValue(final long refreshPeriod) {
352352
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
353353
*/
354354
@Deprecated
355-
public Future<CommandResult> setMinPresentValue(final Double value) {
356-
return write(serverAttributes.get(ATTR_MINPRESENTVALUE), value);
355+
public Future<CommandResult> setMinPresentValue(final Double minPresentValue) {
356+
return write(serverAttributes.get(ATTR_MINPRESENTVALUE), minPresentValue);
357357
}
358358

359359
/**
@@ -420,8 +420,8 @@ public Double getMinPresentValue(final long refreshPeriod) {
420420
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
421421
*/
422422
@Deprecated
423-
public Future<CommandResult> setOutOfService(final Boolean value) {
424-
return write(serverAttributes.get(ATTR_OUTOFSERVICE), value);
423+
public Future<CommandResult> setOutOfService(final Boolean outOfService) {
424+
return write(serverAttributes.get(ATTR_OUTOFSERVICE), outOfService);
425425
}
426426

427427
/**
@@ -486,8 +486,8 @@ public Boolean getOutOfService(final long refreshPeriod) {
486486
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
487487
*/
488488
@Deprecated
489-
public Future<CommandResult> setPresentValue(final Double value) {
490-
return write(serverAttributes.get(ATTR_PRESENTVALUE), value);
489+
public Future<CommandResult> setPresentValue(final Double presentValue) {
490+
return write(serverAttributes.get(ATTR_PRESENTVALUE), presentValue);
491491
}
492492

493493
/**
@@ -569,8 +569,8 @@ public Double getPresentValue(final long refreshPeriod) {
569569
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
570570
*/
571571
@Deprecated
572-
public Future<CommandResult> setReliability(final Integer value) {
573-
return write(serverAttributes.get(ATTR_RELIABILITY), value);
572+
public Future<CommandResult> setReliability(final Integer reliability) {
573+
return write(serverAttributes.get(ATTR_RELIABILITY), reliability);
574574
}
575575

576576
/**
@@ -648,8 +648,8 @@ public Integer getReliability(final long refreshPeriod) {
648648
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
649649
*/
650650
@Deprecated
651-
public Future<CommandResult> setResolution(final Double value) {
652-
return write(serverAttributes.get(ATTR_RESOLUTION), value);
651+
public Future<CommandResult> setResolution(final Double resolution) {
652+
return write(serverAttributes.get(ATTR_RESOLUTION), resolution);
653653
}
654654

655655
/**
@@ -741,8 +741,8 @@ public Double getResolution(final long refreshPeriod) {
741741
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
742742
*/
743743
@Deprecated
744-
public Future<CommandResult> setStatusFlags(final Integer value) {
745-
return write(serverAttributes.get(ATTR_STATUSFLAGS), value);
744+
public Future<CommandResult> setStatusFlags(final Integer statusFlags) {
745+
return write(serverAttributes.get(ATTR_STATUSFLAGS), statusFlags);
746746
}
747747

748748
/**
@@ -873,8 +873,8 @@ public Integer getStatusFlags(final long refreshPeriod) {
873873
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
874874
*/
875875
@Deprecated
876-
public Future<CommandResult> setEngineeringUnits(final Integer value) {
877-
return write(serverAttributes.get(ATTR_ENGINEERINGUNITS), value);
876+
public Future<CommandResult> setEngineeringUnits(final Integer engineeringUnits) {
877+
return write(serverAttributes.get(ATTR_ENGINEERINGUNITS), engineeringUnits);
878878
}
879879

880880
/**
@@ -976,8 +976,8 @@ public Integer getEngineeringUnits(final long refreshPeriod) {
976976
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
977977
*/
978978
@Deprecated
979-
public Future<CommandResult> setApplicationType(final Integer value) {
980-
return write(serverAttributes.get(ATTR_APPLICATIONTYPE), value);
979+
public Future<CommandResult> setApplicationType(final Integer applicationType) {
980+
return write(serverAttributes.get(ATTR_APPLICATIONTYPE), applicationType);
981981
}
982982

983983
/**

com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclBallastConfigurationCluster.java

+27-27
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* <p>
2525
* Code is auto-generated. Modifications may be overwritten!
2626
*/
27-
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2022-05-28T21:15:34Z")
27+
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2024-05-18T20:27:57Z")
2828
public class ZclBallastConfigurationCluster extends ZclCluster {
2929
/**
3030
* The ZigBee Cluster Library Cluster ID
@@ -394,8 +394,8 @@ public Future<CommandResult> setBallastStatusReporting(final int minInterval, fi
394394
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
395395
*/
396396
@Deprecated
397-
public Future<CommandResult> setMinLevel(final Integer value) {
398-
return write(serverAttributes.get(ATTR_MINLEVEL), value);
397+
public Future<CommandResult> setMinLevel(final Integer minLevel) {
398+
return write(serverAttributes.get(ATTR_MINLEVEL), minLevel);
399399
}
400400

401401
/**
@@ -480,8 +480,8 @@ public Integer getMinLevel(final long refreshPeriod) {
480480
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
481481
*/
482482
@Deprecated
483-
public Future<CommandResult> setMaxLevel(final Integer value) {
484-
return write(serverAttributes.get(ATTR_MAXLEVEL), value);
483+
public Future<CommandResult> setMaxLevel(final Integer maxLevel) {
484+
return write(serverAttributes.get(ATTR_MAXLEVEL), maxLevel);
485485
}
486486

487487
/**
@@ -560,8 +560,8 @@ public Integer getMaxLevel(final long refreshPeriod) {
560560
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
561561
*/
562562
@Deprecated
563-
public Future<CommandResult> setPowerOnLevel(final Integer value) {
564-
return write(serverAttributes.get(ATTR_POWERONLEVEL), value);
563+
public Future<CommandResult> setPowerOnLevel(final Integer powerOnLevel) {
564+
return write(serverAttributes.get(ATTR_POWERONLEVEL), powerOnLevel);
565565
}
566566

567567
/**
@@ -624,8 +624,8 @@ public Integer getPowerOnLevel(final long refreshPeriod) {
624624
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
625625
*/
626626
@Deprecated
627-
public Future<CommandResult> setPowerOnFadeTime(final Integer value) {
628-
return write(serverAttributes.get(ATTR_POWERONFADETIME), value);
627+
public Future<CommandResult> setPowerOnFadeTime(final Integer powerOnFadeTime) {
628+
return write(serverAttributes.get(ATTR_POWERONFADETIME), powerOnFadeTime);
629629
}
630630

631631
/**
@@ -691,8 +691,8 @@ public Integer getPowerOnFadeTime(final long refreshPeriod) {
691691
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
692692
*/
693693
@Deprecated
694-
public Future<CommandResult> setIntrinsicBallastFactor(final Integer value) {
695-
return write(serverAttributes.get(ATTR_INTRINSICBALLASTFACTOR), value);
694+
public Future<CommandResult> setIntrinsicBallastFactor(final Integer intrinsicBallastFactor) {
695+
return write(serverAttributes.get(ATTR_INTRINSICBALLASTFACTOR), intrinsicBallastFactor);
696696
}
697697

698698
/**
@@ -769,8 +769,8 @@ public Integer getIntrinsicBallastFactor(final long refreshPeriod) {
769769
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
770770
*/
771771
@Deprecated
772-
public Future<CommandResult> setBallastFactorAdjustment(final Integer value) {
773-
return write(serverAttributes.get(ATTR_BALLASTFACTORADJUSTMENT), value);
772+
public Future<CommandResult> setBallastFactorAdjustment(final Integer ballastFactorAdjustment) {
773+
return write(serverAttributes.get(ATTR_BALLASTFACTORADJUSTMENT), ballastFactorAdjustment);
774774
}
775775

776776
/**
@@ -851,8 +851,8 @@ public Integer getBallastFactorAdjustment(final long refreshPeriod) {
851851
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
852852
*/
853853
@Deprecated
854-
public Future<CommandResult> setLampQuantity(final Integer value) {
855-
return write(serverAttributes.get(ATTR_LAMPQUANTITY), value);
854+
public Future<CommandResult> setLampQuantity(final Integer lampQuantity) {
855+
return write(serverAttributes.get(ATTR_LAMPQUANTITY), lampQuantity);
856856
}
857857

858858
/**
@@ -920,8 +920,8 @@ public Integer getLampQuantity(final long refreshPeriod) {
920920
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
921921
*/
922922
@Deprecated
923-
public Future<CommandResult> setLampType(final String value) {
924-
return write(serverAttributes.get(ATTR_LAMPTYPE), value);
923+
public Future<CommandResult> setLampType(final String lampType) {
924+
return write(serverAttributes.get(ATTR_LAMPTYPE), lampType);
925925
}
926926

927927
/**
@@ -987,8 +987,8 @@ public String getLampType(final long refreshPeriod) {
987987
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
988988
*/
989989
@Deprecated
990-
public Future<CommandResult> setLampManufacturer(final String value) {
991-
return write(serverAttributes.get(ATTR_LAMPMANUFACTURER), value);
990+
public Future<CommandResult> setLampManufacturer(final String lampManufacturer) {
991+
return write(serverAttributes.get(ATTR_LAMPMANUFACTURER), lampManufacturer);
992992
}
993993

994994
/**
@@ -1056,8 +1056,8 @@ public String getLampManufacturer(final long refreshPeriod) {
10561056
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
10571057
*/
10581058
@Deprecated
1059-
public Future<CommandResult> setLampRatedHours(final Integer value) {
1060-
return write(serverAttributes.get(ATTR_LAMPRATEDHOURS), value);
1059+
public Future<CommandResult> setLampRatedHours(final Integer lampRatedHours) {
1060+
return write(serverAttributes.get(ATTR_LAMPRATEDHOURS), lampRatedHours);
10611061
}
10621062

10631063
/**
@@ -1134,8 +1134,8 @@ public Integer getLampRatedHours(final long refreshPeriod) {
11341134
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
11351135
*/
11361136
@Deprecated
1137-
public Future<CommandResult> setLampBurnHours(final Integer value) {
1138-
return write(serverAttributes.get(ATTR_LAMPBURNHOURS), value);
1137+
public Future<CommandResult> setLampBurnHours(final Integer lampBurnHours) {
1138+
return write(serverAttributes.get(ATTR_LAMPBURNHOURS), lampBurnHours);
11391139
}
11401140

11411141
/**
@@ -1217,8 +1217,8 @@ public Integer getLampBurnHours(final long refreshPeriod) {
12171217
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
12181218
*/
12191219
@Deprecated
1220-
public Future<CommandResult> setLampAlarmMode(final Integer value) {
1221-
return write(serverAttributes.get(ATTR_LAMPALARMMODE), value);
1220+
public Future<CommandResult> setLampAlarmMode(final Integer lampAlarmMode) {
1221+
return write(serverAttributes.get(ATTR_LAMPALARMMODE), lampAlarmMode);
12221222
}
12231223

12241224
/**
@@ -1295,8 +1295,8 @@ public Integer getLampAlarmMode(final long refreshPeriod) {
12951295
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
12961296
*/
12971297
@Deprecated
1298-
public Future<CommandResult> setLampBurnHoursTripPoint(final Integer value) {
1299-
return write(serverAttributes.get(ATTR_LAMPBURNHOURSTRIPPOINT), value);
1298+
public Future<CommandResult> setLampBurnHoursTripPoint(final Integer lampBurnHoursTripPoint) {
1299+
return write(serverAttributes.get(ATTR_LAMPBURNHOURSTRIPPOINT), lampBurnHoursTripPoint);
13001300
}
13011301

13021302
/**

0 commit comments

Comments
 (0)