MCPcopy Create free account
hub / github.com/GateNLP/gate-core / isValid

Method isValid

src/main/java/gate/creole/ResourceData.java:361–377  ·  view source on GitHub ↗

Is this a valid resource data configuration? If not, leave an error message that can be returned by getValidityMessage() .

()

Source from the content-addressed store, hash-verified

359 * error message that can be returned by <TT>getValidityMessage()</TT>.
360 */
361 public boolean isValid() {
362 boolean valid = true;
363 validityMessage = "";
364//******************************
365// here should check that the resource has all mandatory elements,
366// e.g. class name, and non-presence of runtime params on LRs and VRs etc.
367//******************************
368 if(getClassName() == null || getClassName().length() == 0){
369 validityMessage += "No class name provided for the resource!";
370 valid = false;
371 }
372 if(getName() == null || getName().length() == 0){
373 //no name provided.
374 setName(className.substring(className.lastIndexOf('.') + 1));
375 }
376 return valid;
377 } // isValid()
378
379 /** Status message set by isValid() */
380 protected String validityMessage = "";

Callers

nothing calls this directly

Calls 5

getClassNameMethod · 0.95
getNameMethod · 0.95
setNameMethod · 0.95
lengthMethod · 0.45
lastIndexOfMethod · 0.45

Tested by

no test coverage detected