Package org.joda.time

Examples of org.joda.time.YearMonth$Property


      if ( level01.getDataItems()[i] instanceof ElementaryDataItem ) {
        ElementaryDataItem edi = (ElementaryDataItem)level01.getDataItems()[i];
        String attrName = edi.getDataName();
        DataField dataField = (DataField)edi.interpret();
        if (dataField != null) {
          Property attr = (Property)attrs.get(attrName);
          Type type = dataField.getType() == Integer.class ? integerType : stringType;
          if (attr == null) {
            String timestampFormat = "";
            String dateFormat = "";
            String length = "" + dataField.getLength();
            String fraction = "" + dataField.getFraction();
            System.out.println("INFO [jIvalo]  - Adding new attribute: " + attrName);
            Property newAttr = addAttribute(c, attrName, type, timestampFormat, dateFormat, length, fraction);
          }
          else {
            System.out.println("INFO [jIvalo]  - Updating new attribute: " + attrName);
            attr.setType(type);
            setTagValue(attr, "length", "" + dataField.getLength());
            setTagValue(attr, "fraction", "" + dataField.getFraction());
            attrs.remove(attrName);
          }
        }
      }
      else if ( level01.getDataItems()[i] instanceof GroupDataItem ) {
        GroupDataItem gdi = (GroupDataItem)level01.getDataItems()[i];
        String className = c.getName() + "_" + gdi.getDataName();
        Class cl = getClass(p, className);
        if (cl == null) {
          addClass(p, className);
          System.out.println("INFO [jIvalo] Added class: " + className);
          cl = getClass(p, className);
        }
        else {
          System.out.println("INFO [jIvalo] Updating existing class: " + className);
        }
       
        if (cl != null) {
          addAttributes(gdi, p, cl, model);
   
          Property newAttr = null;
          if ( level01.getDataItems()[i] instanceof GroupDataItemOccurs ) {
            GroupDataItemOccurs gdio = (GroupDataItemOccurs)level01.getDataItems()[i];
            newAttr = c.createOwnedAttribute(className,p.getOwnedType(cl.getName()),gdio.getOccurs(),gdio.getOccurs());
          }
          else {
            newAttr = c.createOwnedAttribute(className,p.getOwnedType(cl.getName()),1,1);
          }
          if (newAttr != null) {
            newAttr.setVisibility(VisibilityKind.PUBLIC_LITERAL);
            addStereotype(newAttr, jIvaloAttributeStereotype);
            setTagValue(newAttr, "timestampFormat", "");
            setTagValue(newAttr, "dateFormat", "");
            setTagValue(newAttr, "length", "0");
            setTagValue(newAttr, "fraction", "0");
View Full Code Here


    cobolResourceDir = Namespaces.instance().getNamespace(namespace).getProperty("cobolResourceDir").getValue();
    targetPackage = Namespaces.instance().getNamespace(namespace).getProperty("targetPackage").getValue();
   
    jIvaloPackage = getPackage(jIvaloPackageName, model);
    jIvaloClass = getClass(jIvaloPackage, jIvaloClassName);
    Property attribute1 = getAttribute(jIvaloClass, "string");
    stringType = attribute1.getType();
    Property attribute2 = getAttribute(jIvaloClass, "integer");
    integerType = attribute2.getType();

    jIvaloClassStereotype = getStereotype(jIvaloClass, jIvaloClassSteroetypeName);
    jIvaloAttributeStereotype = getStereotype(attribute1, jIvaloAttrSteroetypeName);

  }
View Full Code Here

    Repositories.instance().getImplementation(encoding).writeModel(element,
        outputLocation, xmiVersion);
  }

  private Property addAttribute(Class c, String name, Type type, String timestampFormat, String dateFormat, String length, String fraction) {
    Property p = c.createOwnedAttribute(name, type, 1, 1);
    p.setVisibility(VisibilityKind.PUBLIC_LITERAL);
    setTagValue(p, "timestampFormat", timestampFormat);
    setTagValue(p, "dateFormat", dateFormat);
    setTagValue(p, "length", length);
    setTagValue(p, "fraction", fraction);
    return p;
View Full Code Here

  @CalendarModelAttribute
  public String displayOperations(@PathVariable String accountNumber, @PathVariable int year, @PathVariable int month, ModelMap model) {

    Integer accountId = bankService.findAccountIdByNumber(accountNumber);

    Map<Card, BigDecimal[]> cardSums = bankService.sumResolvedCardOperationsByAccountIdAndYearMonth(accountId, new YearMonth(year, month));
    BigDecimal creditSum = bankService.sumResolvedAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.CREDIT);
    BigDecimal debitSum = bankService.sumResolvedAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.DEBIT);

    model.put("cardSums", cardSums.entrySet());
    model.put("creditSum", creditSum);
    model.put("debitSum", debitSum);
View Full Code Here

  public @ResponseBody
  OperationsTable paginateOperations(@PathVariable String accountNumber, @PathVariable int year, @PathVariable int month, @PathVariable int page) {

    Integer accountId = bankService.findAccountIdByNumber(accountNumber);

    Page<Operation> operationPage = bankService.findNonCardOperationsByAccountIdAndYearMonth(accountId, new YearMonth(year, month), page);
    return converter.convert(operationPage);
  }
View Full Code Here

    BigDecimal creditSum, debitSum = null;

    if (!cardNumber.equals(ALL_CARDS)) {
      Integer cardId = bankService.findCardIdByNumber(cardNumber);
      creditSum = bankService.sumResolvedCardAmountByCardIdAndYearMonthAndSign(cardId, new YearMonth(year, month), OperationSign.CREDIT);
      debitSum = bankService.sumResolvedCardAmountByCardIdAndYearMonthAndSign(cardId, new YearMonth(year, month), OperationSign.DEBIT);

    } else {
      Assert.notNull(accountNumber, "if no cardNumber, accountNumber is required");

      Integer accountId = bankService.findAccountIdByNumber(accountNumber);
      creditSum = bankService.sumResolvedCardAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.CREDIT);
      debitSum = bankService.sumResolvedCardAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.DEBIT);
    }

    model.put("creditSum", creditSum);
    model.put("debitSum", debitSum);
View Full Code Here

    Page<Operation> operations = null;

    if (!cardNumber.equals(CardOperationsController.ALL_CARDS)) {
      Integer cardId = bankService.findCardIdByNumber(cardNumber);
      operations = bankService.findResolvedCardOperationsByCardIdAndYearMonth(cardId, new YearMonth(year, month), page);

    } else {
      Assert.notNull(accountNumber, "if no cardNumber, accountNumber is required");

      Integer accountId = bankService.findAccountIdByNumber(accountNumber);
      operations = bankService.findResolvedCardOperationsByAccountIdAndYearMonth(accountId, new YearMonth(year, month), page);
    }

    return converter.convert(operations);
  }
View Full Code Here

                                                    @RequestParam(defaultValue = "1", value = "page") int page,
                                                    Model model) {

        Pageable pageRequest = PageableFactory.forLists(page);
        Page<Post> result = service.getPublishedPostsByDate(year, month, pageRequest);
        YearMonth yearMonth = new YearMonth(year, month);
        model.addAttribute("title", "Archive for " + yearMonth.toString("MMMM yyyy"));
        return renderListOfPosts(result, model, "All Posts");
    }
View Full Code Here

   {
      public Property apply(V1Property from)
      {
         if (from != null)
         {
            Property result = WSRPTypeFactory.createProperty(from.getName(), from.getLang(), from.getStringValue());
            result.setType(WSRPConstants.XSD_STRING); // todo: not sure what to do here... :(

            List<Object> any = from.getAny();
            if (ParameterValidation.existsAndIsNotEmpty(any))
            {
               result.getAny().addAll(any);
            }
            return result;
         }
         else
         {
View Full Code Here

   public static Property createProperty(QName name, String lang, String stringValue)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(name, "name");

      Property property = new Property();
      property.setName(name);
      if (!ParameterValidation.isNullOrEmpty(lang))
      {
         property.setLang(lang);
      }
      property.setStringValue(stringValue);
      return property;
   }
View Full Code Here

TOP

Related Classes of org.joda.time.YearMonth$Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.