Examples of AnnotationModel


Examples of net.riccardocossu.autodoc.base.AnnotationModel

  @Test
  public void testSimple() {
    JPAPlugin pl = new JPAPlugin();
    Annotation[] annotations = SimpleTestEntity.class.getAnnotations();
    for (Annotation a : annotations) {
      AnnotationModel res = pl.parse(a);
      assertNotNull(res);
    }
  }
View Full Code Here

Examples of net.riccardocossu.autodoc.base.AnnotationModel

  public void testNested() {
    JPAPlugin pl = new JPAPlugin();
    Annotation[] annotations = NestedQueryTestEntity.class.getAnnotations();
    for (Annotation a : annotations) {
      if (a instanceof NamedQueries) {
        AnnotationModel res = pl.parse(a);
        assertNotNull(res);
        assertEquals(1, res.getAttributes().size());
        assertNull(res.getChildren());
        AttributeModel nq = res.getAttributes().get(0);
        assertEquals("value", nq.getName());
        assertTrue(nq.getValue() instanceof AnnotationModel);
        AnnotationModel am = (AnnotationModel) nq.getValue();
        assertEquals(0, am.getAttributes().size());
        List<AnnotationModel> children = am.getChildren();
        assertEquals(1, children.size());
        AnnotationModel firstNq = children.get(0);
        assertEquals(4, firstNq.getAttributes().size());
        AnnotationModel amHA = (AnnotationModel) firstNq
            .getAttributes().get(2).getValue();
        assertEquals(QueryHint.class.getName() + "[]",
            amHA.getQualifiedName());
        List<AnnotationModel> amHACh = amHA.getChildren();
        assertEquals(2, amHACh.get(0).getAttributes().size());
      }

    }
  }
View Full Code Here

Examples of net.riccardocossu.autodoc.base.AnnotationModel

   * net.riccardocossu.autodoc.base.AnnotationsPlugin#parse(java.lang.annotation
   * .Annotation)
   */
  @Override
  public AnnotationModel parse(Annotation target) {
    AnnotationModel am = new AnnotationModel();
    am.setQualifiedName(MXBean.class.getName());
    return am;
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.AnnotationModel

     */
    public void setDocument( IDocument document )
    {
        if ( sourceViewer.getAnnotationModel() == null )
        {
            IAnnotationModel model = new AnnotationModel();
            sourceViewer.setDocument( sourceViewer.getDocument(), model );
        }

        // add annotation painter
        if ( paintManager == null && sourceViewer.getAnnotationModel() instanceof IAnnotationModelExtension )
View Full Code Here

Examples of org.eclipse.jface.text.source.AnnotationModel

    IAnnotationModel oldDiffer= getDiffer();
    if (oldDiffer == null && annotationModel != null)
      return false; // quick diff is enabled, but no differ? not working for whatever reason

    if (annotationModel == null)
      annotationModel= new AnnotationModel();
    if (!(annotationModel instanceof IAnnotationModelExtension))
      return false;

    QuickDiff util= new QuickDiff();
    Object oldDifferId= util.getConfiguredQuickDiffProvider(oldDiffer);
View Full Code Here

Examples of org.eclipse.jface.text.source.AnnotationModel

      if (store != null) {
        String defaultId= store.getString(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER);
        differ= new QuickDiff().createQuickDiffAnnotationModel(getEditor(), defaultId);
        if (differ != null) {
          if (model == null)
            model= new AnnotationModel();
          model.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, differ);
        }
      }
    } else if (differ instanceof ILineDifferExtension2) {
      if (((ILineDifferExtension2) differ).isSuspended())
View Full Code Here

Examples of org.eclipse.jface.text.source.AnnotationModel

   */
  public IAnnotationModel createAnnotationModel(IPath location) {
    IFile file= FileBuffers.getWorkspaceFileAtLocation(location);
    if (file != null)
      return new ResourceMarkerAnnotationModel(file);
    return new AnnotationModel();
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.AnnotationModel

      // we can only create a resource marker annotationmodel off of a
      // valid resource
      if (res != null)
        model = new StructuredResourceMarkerAnnotationModel(res, id);
      else
        model = new AnnotationModel();
    }
    if (model == null) {
      model = super.createAnnotationModel(element);
    }
    return model;
View Full Code Here

Examples of org.eclipse.jface.text.source.AnnotationModel

      // we can only create a resource marker annotationmodel off of a
      // valid resource
      if (res != null)
        model = new StructuredResourceMarkerAnnotationModel(res, id);
      else
        model = new AnnotationModel();
    }
    if (model == null) {
      model = super.createAnnotationModel(element);
    }
    return model;
View Full Code Here

Examples of org.eclipse.jface.text.source.AnnotationModel

    {
        this.document = document;

        if ( this.sourceViewer.getAnnotationModel() == null )
        {
            IAnnotationModel model = new AnnotationModel();
            this.sourceViewer.setDocument( this.sourceViewer.getDocument(), model );
        }

        // add annotation painter
        if ( this.paintManager == null && this.sourceViewer.getAnnotationModel() instanceof IAnnotationModelExtension )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.