/**
* Adds the methods we override from.
* {@link org.exolab.castor.xml.XMLClassDescriptor}
*/
private void addXMLClassDescriptorOverrides() {
JMethod method;
JSourceCode jsc;
//-- create getNameSpacePrefix method
method = new JMethod("getNameSpacePrefix", SGTypes.STRING,
"the namespace prefix to use when marshaling as XML.");
if (_config.useJava50()) {
method.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jsc = method.getSourceCode();
jsc.add("return _nsPrefix;");
addMethod(method);
//-- create getNameSpaceURI method
method = new JMethod("getNameSpaceURI", SGTypes.STRING,
"the namespace URI used when marshaling and unmarshaling as XML.");
if (_config.useJava50()) {
method.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jsc = method.getSourceCode();
jsc.add("return _nsURI;");
addMethod(method);
//-- create getValidator method
method = new JMethod("getValidator", TYPE_VALIDATOR_CLASS,
"a specific validator for the class described"
+ " by this ClassDescriptor.");
if (_config.useJava50()) {
method.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jsc = method.getSourceCode();
jsc.add("return this;");
addMethod(method);
//-- create getXMLName method
method = new JMethod("getXMLName", SGTypes.STRING,
"the XML Name for the Class being described.");
if (_config.useJava50()) {
method.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jsc = method.getSourceCode();
jsc.add("return _xmlName;");
addMethod(method);
}