How to @see a Nested Class

package mappackage;
public class MyMap {
     * Displays the map's legend.
     * @see MyMap.MapLegend
    public void displayLegend() {
        new MapLegend();
    class MapLegend {
        //some code and vars here
}The above is what I have right now, basically. My problem is that javadoc cannot find MapLegend, and I have tried some logical guesses:
- @see MapLegend
- @see MyMap.MapLegend
- @see mappackage.MyMap.MapLegend
...and then other random things like...
- @see #MapLegend
- @see MyMap#MapLegend
- @see this.MapLegend
...I was getting frustrated and desparate.
I was able to @link to MapLegend from another file in the same package by saying MyMap.MapLegend, but I cannot @see my own nested class? That is really annoying. Any ideas?

Hi Syrae,
I just tried @see MapLegend and it worked for me. The problem with your code is that you are trying to link to something that is not visible. If you declare your nested class as public or run javadoc with the -private option, your link should work.
-Jamie

Similar Messages

  • How to see the wrapper classes generated for CMP 2.1 in jdeveloper10g

    I have developed CMP entity bean (2.1) using jdeveloper wizard. I want to see the wrapper class generated for the bean. How can I do that in jdeveloper 10g.

    No you got me wrong. I wan't to see the actual implementated classes (extended from the generated bean) by the container. ie the ones that actually run in the container.
    rgds,
    Jatin

  • How to override a nested class?

    I'm relatively new to Java, so this may be an easy question, but how do you override the behaviour of a nested class when extending a parent class? For example:
    public class MyParentClass
      public class MyParentNestedClass
        public void someMethod()
          // Some functionality that I want to change 
    }Now I want to create a new class, let's call it MyChildClass, which extends MyParentClass and changes the behaviour of the inner class. Is this possible? What is the syntax to accomplish this? Are there any scope-related problems I should be aware of?
    Do I have to extend the parent class in order to redefine the nested class, or is there some way to just override the nested class (which is all I really want to change)? Any help on this would be appreciated, I've searched both the Sun site and Google and can't come up with a really clear answer to this one.
    Thanks,
    Steve

    That's exactly what I was after. I was trying to do it like this:
    public class MyChildClass extends MyParentClass
      MyParentNestedClass childNestedClass = new MyParentNestedClass()
        public void someMethod() { /* new functionality */ }
    }because I have seen anonymous classes (I think they're called adapter classes) declared like this, but it wasn't working in this case. Thanks for showing me the correct way to do it, I guess in retrospect that makes perfect sense, I don't know why I didn't think of it.
    Thanks,
    Steve

  • How to ensure multiple nested classes static readonly initialization orders

    Hello,
    I am emulating the Java Enumeration in a first class class, with static readonly field initialization.
    In an effort to further categorize some instances, I embed them in nested classes. Something like this.
    class A : Enumeration
    public static class CatB
    public static readonly A FirstInstance = new B();
    public static readonly A SecondInstance = new B();
    public static class CatC
    public static readonly A ThirdInstance = new C();
    public static readonly A FourthInstance = new C();
    class B : A
    class C : A
    So far so good.
    One strain of Enumeration has built-in Ordinals, so I initialize them in the static ctor, or I make an effort to.
    static A()
    var values = GetValues().ToList();
    var ordinal = 0;
    values.ForEach(v => v.Ordinal = ++ordinal);
    Also, in places, so far so good.
    However, in a main method, I am referencing one of the enumerated instances, so calls to my GetValues() is returning nulls for that nested class. The other nested class instances are just fine, they return just fine.
    I could post more, but I think this illustrates the idea.
    I am suspicious that a strange static initialization order is jumbled up, as evidenced by nested static ctor debug statements I put in. I get one print and not the other.
    When I switch up which instance I reference in my main, I get the opposite behavior, more or less confirming my suspicions.
    So... Question is, what's the best way to potentially work around this issue? Hopefully without abandoning the Enumeration concern altogether, but that thought is a possibility as well. Or at least do so differently.
    Thank you...

    It is probably necessary to show GetValues() at least. I am getting the correct nested types, so that much we can at least assume.
    protected static IEnumerable<TDerived> GetValues()
    var declaringTypes = GetDeclaringTypes(typeof (TDerived)).ToArray();
    foreach (var declaringType in declaringTypes.Reverse())
    var fis = declaringType.GetFields(PublicStaticDeclaredOnly);
    var values = fis.Select(fi => fi.GetValue(null)).ToArray();
    foreach (var value in values.OfType<TDerived>())
    yield return value;
    Okay, here a bit of explanation.
    Enumeration is declared generically, with TDerived as the derived type. In this case, A.
    GetDeclaringTypes is operating okay. I get types for A, B, and C.
    The fis to values is breaking down, however. When I reference any of the CatB's, I get nulls for those instances. Conversely, same for CatC's when I reference any of those.

  • How to see which methods/classes are important?

    Hi Everyone,
    I am a beginner writing one of my first applications and I have a very newby question. How do I organize and manage many methods (and classes) to see which are the important ones and which are not?
    The questions arised for me because I noticed that I am a bit reluctant to introduce new helper private methods in a class, because I fear there would be too many methods and I couldn’t handle/oversee them... I know it’s probably very wrong and stupid. That’s why I would really like to put it right in me.
    So for example I create a class with a few public methods that are of course the most important part of the class. Those public methods need some more private methods that still do something important and maybe complex thing. But then I stilll need more methods to make clear code in the previous methods. Finally I end up with 20-30 methods in a supposed to be simple class. If I just look into it in Eclipse I have to scroll up and down a lot and even in the package explorer I can’t tell the importants methods apart from the rest. Is this normal?* (Please confirm it is; it would bring relief to me :))
    I thought some kind of method hierarchy shown in the package explorer and expressed in the indentation of the code would help. It would be based on the call hierarchy, but I realize that may be ambiguous. Still, do you know if there is any tool, plugin, solution for this?
    I mean something like this:
    SomeClass:
    ..-veryImportantMethod
    ....-importantMethod
    ....-imprtantMehtod2
    ........-method
    ........-method2
    ........-method3
    ............-reallyNotImportanMethod
    The same thing goes for classes. I start with a few important ones and introduce many less important later. I guess I can’t organize them into different packages based on importance because packages are not for that. It’s just looks strange for me to see a small unimportant helper class opened in the tab next to my main delagator class. (I'm not sure I know correclty what delegator means but that's not important at the moment :))
    I am really just a beginner (needless to say probably :)) but I think it would be easier to intellectually manage the code if there would be some importance hierarchy. It doesn’t even have to be unambiguous as it would only be a way to display the code by the IDE; it wouldn’t affect the program in any way.
    If you have any comments about why this whole thing is not important “because when you write your code..... “ or why I am totally lost and wrong here; I would really appreciate that as well :)
    Thanks in advance,
    lemonboston

    lemonboston wrote:
    Hi Everyone,
    I am a beginner writing one of my first applications and I have a very newby question. How do I organize and manage many methods (and classes) to see which are the important ones and which are not?
    The questions arised for me because I noticed that I am a bit reluctant to introduce new helper private methods in a class, because I fear there would be too many methods and I couldn’t handle/oversee them... I know it’s probably very wrong and stupid. That’s why I would really like to put it right in me.
    So for example I create a class with a few public methods that are of course the most important part of the class. Those public methods need some more private methods that still do something important and maybe complex thing. But then I stilll need more methods to make clear code in the previous methods. Finally I end up with 20-30 methods in a supposed to be simple class. If I just look into it in Eclipse I have to scroll up and down a lot and even in the package explorer I can’t tell the importants methods apart from the rest. Is this normal?* (Please confirm it is; it would bring relief to me :))
    I thought some kind of method hierarchy shown in the package explorer and expressed in the indentation of the code would help. It would be based on the call hierarchy, but I realize that may be ambiguous. Still, do you know if there is any tool, plugin, solution for this?
    I mean something like this:
    SomeClass:
    ..-veryImportantMethod
    ....-importantMethod
    ....-imprtantMehtod2
    ........-method
    ........-method2
    ........-method3
    ............-reallyNotImportanMethod
    The same thing goes for classes. I start with a few important ones and introduce many less important later. I guess I can’t organize them into different packages based on importance because packages are not for that. It’s just looks strange for me to see a small unimportant helper class opened in the tab next to my main delagator class. (I'm not sure I know correclty what delegator means but that's not important at the moment :))
    I am really just a beginner (needless to say probably :)) but I think it would be easier to intellectually manage the code if there would be some importance hierarchy. It doesn’t even have to be unambiguous as it would only be a way to display the code by the IDE; it wouldn’t affect the program in any way.
    If you have any comments about why this whole thing is not important “because when you write your code..... “ or why I am totally lost and wrong here; I would really appreciate that as well :)
    Thanks in advance,
    lemonbostonI think you would benefit from this http://en.wikipedia.org/wiki/Domain-driven_design

  • Nested Class in xpress

    Could someone explain how to instantiate a nested class in xpress? Thanks

    yep sorry about the error there, but it still wont run.
    Through trial and error, ive discoverd that if I comment out the DocumentListener the jar will run fine. This is strange.
    the documentListener now looks like
    DocumentListener listener = new DocumentListener()
          public void changedUpdate(DocumentEvent documentEvent) {
          public void insertUpdate(DocumentEvent documentEvent) {
            if(proceed == true){
                   String temp = textField.getText();
                   System.out.println(temp);
                int tempo = Integer.parseInt(temp);
                   updateBet(tempo);
                   else{
          public void removeUpdate(DocumentEvent documentEvent) {
         };  with this declaration above in the code
    JTextField textField = new JTextField(4);
              final Document document = textField.getDocument();
                    document.addDocumentListener(listener);can anyone see any problems, im tearing my hair out :-<

  • Cloning nested classes

    Does anyone know where I can get information on how
    clone() behaves with nested classes? thanks ...

    I'm actually talking about nested classes (such
    as inner classes), not objects as iv's. Can I assume that an inner class's
    native iv's get a shallow copy as well? I can think of a number of ambiguous
    situations and am wondering if these issues are discussed anywhere, if there
    are any general cautions, etc? Maybe there is nothing to this but on the
    face of it it seems complex.

  • Nested classes inherriting generics?

    I have a comparator decalared in a class, but most of its use will be in a nested class. But i cant figure out how to make the nested class have the same generics as the class its declared in. Some code to help explain my problem.
    import java.util.Comparator;
    public class Test<K, V>
         protected Comparator<? super K> comparator;
         private Node<K,V> root;
         private int size = 0;
         protected final int MINIMUM = 2;
         protected final int MAXIMUM = 2 * this.MINIMUM;
         public Test(Comparator<? super K> comparator)
              this.root = new Node<K, V>();
              this.comparator = comparator;
         @SuppressWarnings({ "hiding", "unchecked" })
         private class Node<K, V>
              Entry<K, V> [] entries = (Entry<K, V>[]) new Object[MAXIMUM];
              @SuppressWarnings("unused")
              Node<K, V> [] links = (Node<K, V>[]) new Object[MAXIMUM + 1];
              public Node(){}
              public void add(K key, V value)
                       int compared = comparator.compare(key, entries[0].key);
              private class Entry<K, V>
                   protected K key;
                   protected V value;
                   public Entry(K key, V value)
                        this.key = key;
                        this.value = value;
    }

    I changed things, but now I am getting a ClassCastException at runtime on the follow lines.
    import java.util.Comparator;
    public class BTree<K, V>
         protected Comparator<? super K> comparator;
         private Node root;
         private int size = 0;
         protected final int MINIMUM = 2;
         protected final int MAXIMUM = 2 * this.MINIMUM;
         public BTree(Comparator<? super K> comparator)
              this.root = new Node();
              this.comparator = comparator;
         public int size()
              return this.size;
         public void add(K key, V value)
              this.root.looseAdd(key, value);
         private class Node
                    //cast cast one these 2 lines
              Entry [] entries = (Entry[]) new Object[MAXIMUM];
              Node [] links = (Node[]) new Object[MAXIMUM + 1];
              public Node(){}
              public void looseAdd(K key, V value)
              private class Entry
                   protected K key;
                   protected V value;
                   public Entry(K key, V value)
                        this.key = key;
                        this.value = value;
    }Edited by: xxpigeonxx on Dec 20, 2009 11:07 PM

  • Questions concerning Nested Classes

    Hi!
    Just read some articles about nested classes (include the ones from the Java Tutorial and the Effective Java chapter), and while most of it is perfectly clear, three questions remain:
    1.) When I declare a member class, how should I declare the access specifiers (private, protected etc.) for the member class's attributes and methods? If I declare a member class as private, anything but private for the attributes and methods wouldn't make sense, would it?
    2.) The Java Tutorial says:
    Also, because an inner class is associated with an instance, it cannot define any static members itself.While this is true for static methods, it seems to be possible to declare static variables inside inner classes. This is confusing me... does it actually make sense to declare static variables inside inner classes (or member classes in general)? Or should the be placed in the declaring class?
    3.) Another confusing quote from the Java Tutorial:
    Static nested classes do not have access to other members of the enclosing class.This is true for instance variables and methods but not for static variables, which are also members of the enclosing class, aren't they?
    Thanks in advance,
    OIiver

    Trollhorn wrote:
    Hi!
    Just read some articles about nested classes (include the ones from the Java Tutorial and the Effective Java chapter), and while most of it is perfectly clear, three questions remain:
    1.) When I declare a member class, how should I declare the access specifiers (private, protected etc.) for the member class's attributes and methods? If I declare a member class as private, anything but private for the attributes and methods wouldn't make sense, would it?
        private static class MyInner implements Runnable
            @Override public void run() // Must be public!
    2.) The Java Tutorial says:
    Also, because an inner class is associated with an instance, it cannot define any static members itself.While this is true for static methods, it seems to be possible to declare static variables inside inner classes. This is confusing me... does it actually make sense to declare static variables inside inner classes (or member classes in general)? Or should the be placed in the declaring class?Wrong. It can define static final member variables and I see no reason to move them to the outer class, if they are used only by the inner class.
    3.) Another confusing quote from the Java Tutorial:
    Static nested classes do not have access to other members of the enclosing class.This is true for instance variables and methods but not for static variables, which are also members of the enclosing class, aren't they?I agree with you here.
    Edited by: baftos on Jun 6, 2009 9:18 AM

  • When to use Nested Class/Inner Classes ?

    I am not very clear, when to use nested/inner classes..
    The scenario is :-
    class ABC
    //ABC need to store multiple instance of class XYZ
    class XYZ
    int member1;
    int member2;
    One approach is
    class ABC
    class XYZ
    //vector of class XYZ instances is stored in class-ABC
    or another approach is Class XYZ can be in separate JAVA file.
    Query:-
    1) Is there any difference between nested or Inner class...or are they same?
    2) When should they be used....Is it good to use in above scenario.
    3) What are the disadvtanges/advantages of using the Nested
    class.

    Query:-
    1) Is there any difference between nested or Inner
    class...or are they same?I really don't get it. Yes there is a difference between having an inner class, and a class in a separate file, but a nested class is an inner class.
    2) When should they be used....Is it good to use in
    above scenario.To write an inner class is a design decision. Do other classes need to know about the class XYZ or not? Do the XYZ class need to know about the inner working of the ABC class? How complex is the XYZ class etc.
    >
    3) What are the disadvtanges/advantages of using the
    Nested
    class.See above.
    /Kaj

  • Extending inner [nested] classes

    OK I've got a class (A) with a nested class (B).
    B accesses variables etc. in A and does its own thing, but what I'd like to do is make B abstract and have a number of classes extend it - which is used depends on program arguments.
    The problem I'm having is that the new class (C) that extends B does not seem to have access to any of the variables in A.
    I originally tried:
    class C extends B
    and
    class C extends A$B
    I also tried this, which I found on this site:
    class C extends A.B
    (thats A-dot-B) but it still doesnt seem to be working.
    Is it possible to extend [abstract] inner classes like this? If so, how? Any help appreciated. cheers.

    Here I found a solution. However, it is not so elegant. In fact, I am also having trouble in extending a nested class in an elegant way.
    Here, A is the original top-level class and A.B is the nested class of A. A2 extends A. B2 and B3 extends A.B. Main is the class where the main() method can be found.
    // A.java
    public class A {
      private B b;
      public void setB (B b) {
        this.b = b;
      public B getB () {
        return b;
      public abstract class B {
        public abstract String getName();
    // A2.java
    public class A2 extends A {
      public class B2 extends A.B {
        public String getName () {
          return "Peter";
      public class B3 extends A.B {
        public String getName () {
          return "John";
    public class Main {
      public static void main (String[] args) {
        A a = new A2 ();
        A.B b = ((A2)a).new B2 ();
        a.setB (b);
        System.out.println (a.getB().getName());  // John
        b = ((A2)a).new B3 ();
        a.setB (b);
        System.out.println (a.getB().getName());  // Peter
    }You may see here that I used "A" as the type of "a". Te reason is I want to use "a" as an "A", not "A2". If you don't want to do casting, you may simply use "A2" as the type. The class A2 can be blank. It is only a "container" of the classes B2 and B3.

  • How can I hide the class file ??

    Hi !
    I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. Thinks

    See these....
    http://www.saffeine.com/
    http://www.jarsafe.com/
    I recently read this. This will help you.
    http://developer.java.sun.com/developer/qow/archive/160/index.jsp
    Enojy....
    Rajesh

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How can I access another class in a MembershipRule's Expression

    Hello,
    I want to create an InstanceGroup using Module Microsoft.SystemCenter.GroupPopulator.
    I need to collect all Logical Disks which contain an MS SQL DB Log File.
    I would start as follows:
    <DataSource ID="DS" TypeID="SC!Microsoft.SystemCenter.GroupPopulator">
      <RuleId>$MPElement$</RuleId>
      <GroupInstanceId>$Target/Id$</GroupInstanceId>
      <MembershipRules>
        <MembershipRule>
          <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.LogicalDisk"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MSIL!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>     
    <Expression>
            <And>
      <!--
       First Expression
      -->
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <Property>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/Name$</Property>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
      <!--
        How can I access another class's properties ? 
      -->
                    <GenericProperty>$MPElement[Name="SQL!Microsoft.SQLServer.2008.DBLogFile"]/Drive$</GenericProperty>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <HostProperty>
                      <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]</MonitoringClass>
                      <Property>PrincipalName</Property>
                    </HostProperty>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <GenericProperty>$MPElement[Name="SQL!Microsoft.SQLServer.2008.DBLogFile"]/Drive$</GenericProperty>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </And>
          </Expression>
        </MembershipRule>
      </MembershipRules>
    </DataSource>
    In the first expression you "see" my question:
    I want to compare the LogicalDisk's Name Property with the DB Log File's Drive property.
    But how can I access the DB Log File's Drive property in this MembershipRule ?
    Furthermore LogicalDisk and DB Log File must be hosted on the same Windows Computer.
    Would be great if somebody could help.
    Thanks
    Sebastian

    Hi Niki,
    thanks for the idea, but that will not work. $Target/Id$ refers always to the group to be discovered.
    On last week end I was given following idea, hope it will work:
    Step 1
    Collect all the DB SQL Logfile Objects and write computername (PrincipalName?) and Driveletter into a textfile, line by line. Shouldn't be a problem, PowerShell is your friend.
    Step 2
    Read the file from Step 1, build discovery data for each disk drive as object of class "Logical Disk (Server)",
    and then discover the containment-relationships from those Logical Drive(Server) Objects to the InstanceGroup.
    Perhaps I must do it for the OS-Version related Disks, because I need the target classes  of the Logical Disk Freespace monitors. Some more work. "Risks": I donot know the discovery algorithm for the Logical Disk(Server) Objects, but a "deep
    dive" into the MPs should help.
    Thanks to all, who have read.
    I will inform you about progress and success
    sebastian

  • How to see wsdl in JBoss?

    Hi,
    I have deployed a WebService application in JBoss. How to see wsdl at server (JBoss) side?
    I have supplied url: http://localhost:8080 in the browser,
    It is showing the below page, from here how to see the wsdl file?
    JBoss Online Resources
        * JBoss Documentation
        * JBoss Wiki
        * JBoss JIRA
        * JBoss Forums
    JBoss Management
        * Tomcat status (full) (XML)
        * JMX Console
        * JBoss Web Consolethank you for your consideration,

    Hi,
    I have downloaded an application from internet
    The interface is :
    package webservice1;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import javax.jws.soap.SOAPBinding;
    import javax.jws.soap.SOAPBinding.Style;
    @WebService(name="Calculator1")
    @SOAPBinding(style=Style.RPC)
    public interface Calculator extends Remote
       @WebMethod int add(int x, int y);
       @WebMethod int subtract(int x, int y);
    }and the implementation is:
    package webservice1;
    import javax.ejb.Stateless;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    import javax.jws.soap.SOAPBinding.Style;
    @Stateless
    @WebService(name="Calculator1", endpointInterface="webservice1.Calculator")
    public class CalculatorBean implements Calculator
       public int add(int x, int y)
          return x + y;
       public int subtract(int x, int y)
          return x - y;
    }application folder name: calculatorwebservice
    I am giving the url:
    http://127.0.0.1:8080/calculatorwebservice/Calculator1?wsdlbut JBoss giving Error: 404
    HTTP Status 404 - /calculatorwebservice/Calculator1
    type Status report
    message /calculatorwebservice/Calculator1
    description The requested resource (/calculatorwebservice/Calculator1) is not available.
    Apache Tomcat/5.5.20I am unable to give proper URL, according to the above code what could be the url to look the WSDL?
    thank you for your kind consideration,

Maybe you are looking for