Package org.pdfsam.console.business.dto

Examples of org.pdfsam.console.business.dto.PageLabel


  /**
   * @param inputString
   * @return the PageLabel object resulting by the -l option value
   */
  public static PageLabel getPageLabel(final String inputString) throws ValidationException {
    PageLabel retVal = null;
    if (inputString != null && inputString.length() > 0) {
      String[] values = inputString.split(":");
      if (values.length >= 2) {
        try {
          retVal = new PageLabel();
          retVal.setPageNumber(Integer.parseInt(values[0]));
          if (values.length == 3) {
            retVal.setLogicalPageNumber(Integer.parseInt(values[2]));
          }
        } catch (Exception e) {
          throw new ValidationException(ValidationException.ERR_WRONG_PAGE_LABEL, new String[] { inputString }, e);
        }

        // style
        retVal.setStyle(getPageLabelStyle(values[1]));
      } else {
        throw new ValidationException(ValidationException.ERR_WRONG_PAGE_LABEL, new String[] { inputString });
      }
    }
    return retVal;
View Full Code Here


          //-l
          StringParam lOption = (StringParam) cmdLineHandler.getOption(PageLabelsParsedCommand.L_ARG);
          if(lOption.isSet()){
            for(Iterator lIterator = lOption.getValues().iterator(); lIterator.hasNext();){
              String currentLabel = (String) lIterator.next();
              PageLabel currentPageLabel = ValidationUtility.getPageLabel(currentLabel);
              if(labels.containsKey(new Integer(currentPageLabel.getPageNumber()))){
                log.warn("Duplicate label starting at page "+currentPageLabel.getPageNumber()+" will be ignored.");
              }else{
                labels.put(new Integer(currentPageLabel.getPageNumber()), currentPageLabel);
              }
            }
          }
         
          //-lp
View Full Code Here

TOP

Related Classes of org.pdfsam.console.business.dto.PageLabel

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.