1
public enum AnnotationType
{

  static
  {
    AnnotationType[] arrayOfAnnotationType = new AnnotationType[9];
    AnnotationType CIRCLE;
    arrayOfAnnotationType[0] = CIRCLE;
    AnnotationType FREETEXT;
    arrayOfAnnotationType[1] = FREETEXT;
    AnnotationType HIGHLIGHT;
    arrayOfAnnotationType[2] = HIGHLIGHT;
    AnnotationType INK;
    arrayOfAnnotationType[3] = INK;
    AnnotationType LINE;
    arrayOfAnnotationType[4] = LINE;
    AnnotationType NOTE;
    arrayOfAnnotationType[5] = NOTE;
    AnnotationType SQUARE;
    arrayOfAnnotationType[6] = SQUARE;
    AnnotationType STRIKETHROUGH;
    arrayOfAnnotationType[7] = STRIKETHROUGH;
    AnnotationType UNDERLINE;
    arrayOfAnnotationType[8] = UNDERLINE;
    AnnotationType[] ENUM$VALUES = arrayOfAnnotationType;
  }

Here i got the syntax error insert "Identifier" to complete Enum Constant Header .How to rectify this....

}

3 Answers3

4

That's just not the way you declare enums. You'd normally have:

public enum AnnotationType
{
     CIRCLE, FREETEXT, HIGHLIGHT, INK, LINE, NOTE, SQUARE,
     STRIKETHROUGH, UNDERLINE;
}

... although you could create your own constructor and pass data to it, etc.

This looks like you're basically trying to recompile the output of a decompiler. Why do you need to do that?

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • i want to add annotation in pdf viewer. –  Feb 14 '12 at 07:24
  • yes.i decompile all the source code using decompiler.how to add annotation in pdf viewer.is there any soultions –  Feb 14 '12 at 07:27
  • @Raj: It's not clear which PDF viewer you're talking about, or why that would involve decompiling code... why can you not just add a classpath entry to the existing code? – Jon Skeet Feb 14 '12 at 07:27
  • i want to add annotation in my android pdf viewer.so i dont have any idea to add annotation in android pdf viewer.so i decompile source code from other pdf viewer. –  Feb 14 '12 at 08:26
  • @Raj: That doesn't sound like a good first step, and may even be illegal depending on the licence and your country. It's not clear whether you're trying to add an annotation to the PDF, or change *viewing* the PDF... but either way, decompiling someone else's code (and doing it badly) doesn't sound like the best approach. – Jon Skeet Feb 14 '12 at 08:28
  • i want to add annotation in android pdf viewer.for example if i want to highlight the pdf page using canvas.how to do that ..i searched long days.. –  Feb 14 '12 at 08:31
  • @Raj: It's still not clear whether you're trying to modify an existing PDF *viewer* (or what the legal ramifications of that are - do you own the code to that viewer) or whether you just want to add an annotation to the PDF document itself. I don't expect either of these will be simple tasks, to be honest... but modifying a PDF document is likely to be simpler, as there are various PDF manipulation libraries around. – Jon Skeet Feb 14 '12 at 08:38
  • i have the source code of android pdf viewer.but i want to add some futures like annotation.how to do that –  Feb 14 '12 at 08:41
  • actually i got the android pdf viewer from google developers website.but i want to add some futures...they are having only pdf viewer. –  Feb 14 '12 at 08:44
  • @Raj: And does the licence allow you to modify it? If so, that's great - but why would you end up *decompiling* code? That *really* isn't the way to go. – Jon Skeet Feb 14 '12 at 08:46
  • It's a open source code for android pdf viewer.see the developers website.i downloaded it from google .the pdf viewer name is APV pdf viewer in android.another pdf viewer has some licensed way.they have all futures.thats why i decompile the source code –  Feb 14 '12 at 08:48
  • How to add annotation http://stackoverflow.com/questions/9173164/how-to-highlight-this-pdf-page-using-ontouchevent-in-android –  Feb 14 '12 at 08:53
  • can u suggest me the solution –  Feb 14 '12 at 08:54
  • @Raj: I would assume that if the other PDF viewer hasn't made their source available, you shouldn't be decompiling it. If they *have* made their code available, then you don't need to decompile it anyway. – Jon Skeet Feb 14 '12 at 08:54
  • yes.they are having license.they haven't made their source code in the market. –  Feb 14 '12 at 09:00
  • @Raj: If they haven't given their source code, you should approach them and see if they're willing to share it with you. If they're not, then I would argue that morally and quite possibly legally you shouldn't be decompiling their code. If you want a feature, work out how to implement it yourself. – Jon Skeet Feb 14 '12 at 09:06
2

Jon Skeet is right, but also this will do what you want with regards to the array:

AnnotationType[] arrayOfAnnotationType = AnnotationType.values();
  • It's not clear to me that he *does* want an array. It looks like he's just trying to get some badly-decompiled code to compile again - which isn't a great first step, IMO. – Jon Skeet Feb 14 '12 at 08:38
  • @JonSkeet Yep... you're right. It's just badly decompiled. I only skimmed the code. –  Feb 14 '12 at 08:41
1

Poor decompile!!!

public static enum AnnotationType
{
    CIRCLE,
    FREETEXT,
    HIGHLIGHT,
    INK,
    LINE,
    NOTE,
    SQUARE,
    STRIKETHROUGH,
    UNDERLINE,
  }

public AnnotationType[] arrayOfAnnotationType = AnnotationType.values(); 
public AnnotationType[] ENUM$VALUES = arrayOfAnnotationType;

The last two... only if you need the Arrays ???

Rob.Scribe
  • 117
  • 1
  • 1