Exemplo n.º 1
0
  public boolean needsChange(DynamicType newType) {
    if (!hasType(newType)) {
      return false;
    }
    DynamicTypeImpl type = getType();
    if (!newType.getKey().equals(type.getKey())) return true;

    for (String key : data.keySet()) {
      Attribute attribute = getType().getAttribute(key);
      if (attribute == null) {
        return true;
      }
      String attributeId = attribute.getId();
      if (type.hasAttributeChanged((DynamicTypeImpl) newType, attributeId)) return true;
    }
    return false;
  }
Exemplo n.º 2
0
 public Function resolveVariableFunction(String variableName) throws IllegalAnnotationException {
   Attribute attribute = type.getAttribute(variableName);
   if (attribute != null) {
     return new AttributeFunction(attribute);
   } else if (variableName.equals(type.getKey())) {
     return new TypeFunction(type);
   } else if (variableName.equals("type:type")) {
     return new ThisTypeFunction();
   } else if (variableName.equals("event:allocatables")
       || variableName.equals("event:resources")) {
     return new AllocatableFunction(type);
   } else if (variableName.equals("event:appointments")) {
     return new AppointmentFunction(type);
   } else if (variableName.equals("appointmentBlock:number")) {
     return new AppointmentBlockFunction(type);
   } else if (variableName.equals("appointment:allocatables")) {
     return new AllocatableFunction(type);
   } else if (variableName.equals("appointmentBlock:allocatables")) {
     return new AllocatableFunction(type);
   }
   return null;
 }
Exemplo n.º 3
0
 ClassificationImpl(DynamicTypeImpl dynamicType) {
   typeId = dynamicType.getId();
   type = dynamicType.getKey();
 }