public Object[] getDefaultValues(org.eclipse.emf.ecore.EAttribute attribute) {
   String typeName = attribute.getEType().getName();
   if ("EString".equals(typeName)) {
     return new Object[] {
       "some" + ASPMM.resource.ASPMM.util.ASPMMStringUtil.capitalize(attribute.getName())
     };
   }
   if ("EBoolean".equals(typeName)) {
     return new Object[] {Boolean.TRUE, Boolean.FALSE};
   }
   return new Object[] {attribute.getDefaultValue()};
 }
예제 #2
0
 public String getClassAttributes(EClass eClass) {
   // if attributes exist
   if (eClass.getEAttributes().size() > 0) {
     StringBuilder sb = new StringBuilder();
     sb.append("\\subsubsection*{Attributes}\n");
     sb.append("\\begin{itemize}\n");
     // for each attribute
     for (EAttribute eAttribute : eClass.getEAttributes()) {
       sb.append("\\item ");
       // Name
       sb.append(eAttribute.getName()).append(": ");
       // Type
       if (eAttribute.getEAttributeType().getInstanceClass() != null) {
         sb.append(eAttribute.getEAttributeType().getInstanceClass().getSimpleName()).append(" ");
       } else {
         sb.append("\\nameref{").append(eAttribute.getEAttributeType().getName()).append("} ");
       }
       // Mult
       sb.append(getMultiplicity(eAttribute)).append(" ");
       // Default Value
       if (eAttribute.getDefaultValue() != null) {
         sb.append(" \\textit{~=~").append(eAttribute.getDefaultValue()).append("} ");
       }
       // Description
       if (getLatexDocAnnotation(
               eAttribute, prefs.getPreferenceString(PreferenceConstants.P_DESCRIPTION_KEY))
           != null) {
         sb.append("\\newline\n")
             .append(
                 getLatexDocAnnotation(
                     eAttribute,
                     prefs.getPreferenceString(PreferenceConstants.P_DESCRIPTION_KEY)));
       }
       sb.append("\n");
     } // for each attribute
     sb.append("\\end{itemize}");
     return sb.toString();
   }
   return "\\subsubsection*{Attributes} ~\\\\ No additional attributes";
 }
 public Object[] getDefaultValues(EAttribute attribute) {
   String typeName = attribute.getEType().getName();
   if ("EString".equals(typeName)) {
     return new Object[] {
       "some"
           + org.dresdenocl.language.ocl.resource.ocl.util.OclStringUtil.capitalize(
               attribute.getName())
     };
   }
   if ("EBoolean".equals(typeName)) {
     return new Object[] {Boolean.TRUE, Boolean.FALSE};
   }
   return new Object[] {attribute.getDefaultValue()};
 }
 public java.lang.Object[] getDefaultValues(org.eclipse.emf.ecore.EAttribute attribute) {
   String typeName = attribute.getEType().getName();
   if ("EString".equals(typeName)) {
     return new java.lang.Object[] {
       "some"
           + west.twouse.language.sparqlas.resource.sparqlas.util.SparqlasStringUtil.capitalize(
               attribute.getName())
     };
   }
   if ("EBoolean".equals(typeName)) {
     return new java.lang.Object[] {Boolean.TRUE, Boolean.FALSE};
   }
   return new java.lang.Object[] {attribute.getDefaultValue()};
 }