package org.verapdf.model.impl.pb.cos;

import org.apache.pdfbox.cos.COSBase;
import org.apache.pdfbox.cos.COSObject;
import org.verapdf.model.GenericModelObject;
import org.verapdf.model.tools.IDGenerator;
import org.verapdf.model.coslayer.CosObject;
import org.verapdf.model.visitor.cos.pb.PBCosVisitor;

import java.io.IOException;

/**
 * Created by Evgeniy Muravitskiy on 4/27/15.
 * <p>
 *     Current class is representation of CosObject interface of abstract model.
 *     This class is analogue of COSBase in pdfbox.
 * </p>
 */
public class PBCosObject extends GenericModelObject implements CosObject {

    protected COSBase baseObject;

    private String type = "CosObject";
    private String id;

    public PBCosObject(COSBase baseObject) {
        this.baseObject = baseObject;
        id = IDGenerator.generateID(this.baseObject);
    }

    /** Get type of current object
     */
    @Override
    public String getType() {
        return type;
    }

    protected void setType(String type) {
        this.type = type;
    }

    /** Get personal id of current object
     */
    @Override
    public String getID() {
        return id;
    }

    public static CosObject getFromValue(COSBase base) {
        try {
            PBCosVisitor visitor = new PBCosVisitor();
            if (base instanceof COSObject) {
                return (CosObject) visitor.visitFromObject((COSObject) base);
            } else {
                return (CosObject) base.accept(visitor);
            }
        } catch (IOException ignore) {
            return null;
        }
    }
}

@@ -339,65 +339,8 @@
 *%0A *
- Created by Evgeniy Muravitskiy on 4/27/15.%0A * %3Cp%3E%0A *    
  Cur
@@ -412,20 +412,16 @@
 odel.%0A *
-    
  This cl
@@ -464,13 +464,39 @@
 .%0A *
- %3C/p%3E
+%0A * @author Evgeniy Muravitskiy
 %0A */
@@ -1118,24 +1118,366 @@
  id;%0A    %7D%0A%0A
+    /**%0A     * Transform object of pdf box to corresponding object of abstract model implementation. For transforming%0A     * using %7B@code PBCosVisitor%7D.%0A     * @param base the base object that all objects in the PDF document will extend in pdf box%0A     * @return object of abstract model implementation, transformed from %7B@code base%7D%0A     */%0A
     public s
@@ -1573,12 +1573,8 @@
 or =
- new
  PBC
@@ -1582,16 +1582,28 @@
 sVisitor
+.getInstance
 ();%0A    

Add javadoc for public method. Changes for visitor.