File |
Line |
org\andromda\cartridges\jsf\metafacades\JSFAttributeLogicImpl.java |
111 |
org\andromda\cartridges\jsf\metafacades\JSFManageableEntityAttributeLogicImpl.java |
395 |
}
/**
* @return dummyValue
* @see JSFAttribute#getDummyValue()
*/
protected String handleGetDummyValue()
{
final ClassifierFacade type = this.getType();
if (type != null)
{
final String typeName = type.getFullyQualifiedName();
final String name = this.getName();
if ("String".equals(typeName))
{
return "\"" + name + "-test" + "\"";
}
if ("java.util.Date".equals(typeName))
{
return "new java.util.Date()";
}
if ("java.sql.Date".equals(typeName))
{
return "new java.sql.Date(new java.util.Date().getTime())";
}
if ("java.sql.Timestamp".equals(typeName))
{
return "new java.sql.Timestamp(new Date().getTime())";
}
if ("java.util.Calendar".equals(typeName))
{
return "java.util.Calendar.getInstance()";
}
if ("int".equals(typeName))
{
return "(int)" + name.hashCode();
}
if ("boolean".equals(typeName))
{
return "false";
}
if ("long".equals(typeName))
{
return "(long)" + name.hashCode();
}
if ("char".equals(typeName))
{
return "(char)" + name.hashCode();
}
if ("float".equals(typeName))
{
return "(float)" + name.hashCode() / hashCode();
}
if ("double".equals(typeName))
{
return "(double)" + name.hashCode() / hashCode();
}
if ("short".equals(typeName))
{
return "(short)" + name.hashCode();
}
if ("byte".equals(typeName))
{
return "(byte)" + name.hashCode();
}
if ("java.lang.Integer".equals(typeName) || "Integer".equals(typeName))
{
return "new Integer((int)" + name.hashCode() + ")";
}
if ("java.lang.Boolean".equals(typeName) || "Boolean".equals(typeName))
{
return "Boolean.FALSE";
}
if ("java.lang.Long".equals(typeName) || "Long".equals(typeName))
{
return "new Long((long)" + name.hashCode() + ")";
}
if ("java.lang.Character".equals(typeName) || "Character".equals(typeName))
{
return "new Character(char)" + name.hashCode() + ")";
}
if ("java.lang.Float".equals(typeName) || "Float".equals(typeName))
{
return "new Float((float)" + name.hashCode() / hashCode() + ")";
}
if ("java.lang.Double".equals(typeName) || "Double".equals(typeName))
{
return "new Double((double)" + name.hashCode() / hashCode() + ")";
}
if ("java.lang.Short".equals(typeName) || "Short".equals(typeName))
{
return "new Short((short)" + name.hashCode() + ")";
}
if ("java.lang.Byte".equals(typeName) || "Byte".equals(typeName))
{
return "new Byte((byte)" + name.hashCode() + ")";
}
//if (type.isArrayType()) return constructDummyArray();
if (type.isSetType())
{
return "new java.util.HashSet(java.util.Arrays.asList(" + constructDummyArray() + "))";
}
if (type.isCollectionType())
{
return "java.util.Arrays.asList(" + constructDummyArray() + ")";
}
// maps and others types will simply not be treated
}
return "null";
} |
File |
Line |
org\andromda\cartridges\jsf\metafacades\JSFAttributeLogicImpl.java |
685 |
org\andromda\cartridges\jsf\metafacades\JSFParameterLogicImpl.java |
1032 |
final Collection<FrontEndView> views = ownerParameter.getAction().getTargetViews();
for (final Iterator<FrontEndView> iterator = views.iterator(); iterator.hasNext() && !required;)
{
final Collection<FrontEndParameter> parameters = iterator.next().getAllActionParameters();
for (final Iterator<FrontEndParameter> parameterIterator = parameters.iterator();
parameterIterator.hasNext() && !required;)
{
final FrontEndParameter object = parameterIterator.next();
if (object instanceof JSFParameter)
{
final JSFParameter parameter = (JSFParameter)object;
final String parameterName = parameter.getName();
final ClassifierFacade parameterType = parameter.getType();
if (parameterType != null)
{
final String parameterTypeName = parameterType.getFullyQualifiedName();
if (name.equals(parameterName) && typeName.equals(parameterTypeName))
{
required = parameter.isInputTable();
}
}
}
}
}
}
}
else if (ownerParameter.isControllerOperationArgument()) |
File |
Line |
org\andromda\cartridges\jsf\metafacades\JSFParameterLogicImpl.java |
1192 |
org\andromda\cartridges\jsf\metafacades\JSFParameterLogicImpl.java |
1215 |
final String format = JSFUtils.getInputFormat((ModelElementFacade)this.THIS());
final String rangeStart = JSFUtils.getRangeStart(format);
boolean addComma=false;
if(StringUtils.isNotBlank(rangeStart) && !rangeStart.equals(UNDEFINED_BOUND))
{
sb.append("minimum="+rangeStart);
addComma=true;
}
final String rangeEnd = JSFUtils.getRangeEnd(format);
if(StringUtils.isNotBlank(rangeEnd) && !rangeEnd.equals(UNDEFINED_BOUND))
{
if(addComma)
{
sb.append(",");
}
sb.append("maximum="+rangeEnd);
}
sb.append(")");
result.add(sb.toString());
}
else if(JSFUtils.VT_FLOAT_RANGE.equals(vt) || JSFUtils.VT_DOUBLE_RANGE.equals(vt)) |
File |
Line |
org\andromda\cartridges\jsf\metafacades\JSFManageableEntityAssociationEndLogicImpl.java |
87 |
org\andromda\cartridges\jsf\metafacades\JSFManageableEntityAttributeLogicImpl.java |
190 |
}
/**
* @return backingListName
* @see org.andromda.cartridges.jsf.metafacades.JSFManageableEntityAssociationEnd#getBackingListName()
*/
protected String handleGetBackingListName()
{
final String backingListName =
StringUtils.replace(
ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.BACKING_LIST_PATTERN)),
"{0}",
this.getName());
return org.andromda.utils.StringUtilsHelper.lowerCamelCaseName(backingListName);
}
/**
* @return valueListName
* @see org.andromda.cartridges.jsf.metafacades.JSFManageableEntityAssociationEnd#getValueListName()
*/
protected String handleGetValueListName()
{
return ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.VALUE_LIST_PATTERN)).replaceAll(
"\\{0\\}",
this.getName());
}
/**
* @return labelListName
* @see org.andromda.cartridges.jsf.metafacades.JSFManageableEntityAssociationEnd#getLabelListName()
*/
protected String handleGetLabelListName()
{
return ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.LABEL_LIST_PATTERN)).replaceAll(
"\\{0\\}",
this.getName());
} |
File |
Line |
org\andromda\cartridges\jsf\JSFUtils.java |
1206 |
org\andromda\cartridges\jsf\metafacades\JSFActionLogicImpl.java |
676 |
final String signature = buffer.toString();
String serialVersionUID = String.valueOf(0L);
try
{
MessageDigest md = MessageDigest.getInstance("SHA");
byte[] hashBytes = md.digest(signature.getBytes());
long hash = 0;
for (int ctr = Math.min(
hashBytes.length,
8) - 1; ctr >= 0; ctr--)
{
hash = (hash << 8) | (hashBytes[ctr] & 0xFF);
}
serialVersionUID = String.valueOf(hash);
}
catch (final NoSuchAlgorithmException exception)
{ |
File |
Line |
org\andromda\cartridges\jsf\metafacades\JSFAttributeLogicImpl.java |
352 |
org\andromda\cartridges\jsf\metafacades\JSFParameterLogicImpl.java |
574 |
final FrontEndParameter object = parameterIterator.next();
if (object instanceof JSFParameter)
{
final JSFParameter parameter = (JSFParameter)object;
final String parameterName = parameter.getName();
final ClassifierFacade parameterType = parameter.getType();
if (parameterType != null)
{
final String parameterTypeName = parameterType.getFullyQualifiedName();
if (name.equals(parameterName) && typeName.equals(parameterTypeName))
{
selectable =
parameter.isInputMultibox() || parameter.isInputSelect() ||
parameter.isInputRadio();
}
}
}
}
}
}
}
else if (ownerParameter.isControllerOperationArgument()) |