Package org.oorexx.language.directive

Examples of org.oorexx.language.directive.OORexxClass


        if(commentAble instanceof OORexxRoutine || commentAble instanceof OORexxOptions
            || commentAble instanceof OORexxRequires)
          previousClass = null;
       
        if(previousClass != null && (commentAble instanceof OORexxMethod || commentAble instanceof OORexxAttribute || commentAble instanceof OORexxConstant)){
          OORexxClass clazz = (OORexxClass) this.directiveMap.get(previousClass.getName());
            if(commentAble instanceof OORexxMethod && commentAble.getName().toLowerCase().equals("init"))
              clazz.setInit((OORexxMethod)commentAble);
            if(commentAble instanceof OORexxMethod && !commentAble.getName().toLowerCase().equals("init"))
              clazz.appendMethod((OORexxMethod)commentAble);
            if(commentAble instanceof OORexxAttribute)
              clazz.appendAttribute((OORexxAttribute) commentAble)
            if(commentAble instanceof OORexxConstant)
              clazz.appendConstant((OORexxConstant) commentAble);
           
             
         
          Collections.sort(clazz.getMethods());
          Collections.sort(clazz.getAttributes());
          Collections.sort(clazz.getConstants());
         
          this.directiveMap.put(previousClass.getName(), clazz);
        }
       
        if(previousClass == null || commentAble instanceof OORexxClass){
View Full Code Here


import org.oorexx.language.enumeration.OORexxAccessModifier;

public class LineToOORexxClass {
  public static OORexxClass convert(String line){
    OORexxKeywordBean keywordBean = LanguageBeanFactory.getOORexxKeywordBean();
    OORexxClass ooRexxClass = new OORexxClass();
   
    String[] words = line.split(" +");
   
    for(int i = 0; i < words.length ; i++){
      if(words[i].toLowerCase().equals("::class"))
        ooRexxClass.setName(words[i+1].replace("'", "").replace("\"", ""));
     
     
      if(words[i].toLowerCase().equals("public"))
        ooRexxClass.setAccessModifier(OORexxAccessModifier.PUBLIC);
      else if(words[i].toLowerCase().equals("private"))
        ooRexxClass.setAccessModifier(OORexxAccessModifier.PRIVATE);
     
      if(words[i].toLowerCase().equals("subclass"))
        ooRexxClass.setSubClass(new OORexxClass(words[i+1]));
     
     
      if(words[i].toLowerCase().equals("mixinclass"))
        ooRexxClass.setMixinClass(new OORexxClass(words[i+1]));
     
     
      if(words[i].toLowerCase().equals("inherit")){
        for(int k = i + 1; k < words.length ; k++){
          if(keywordBean.getClassKeywords().contains(words[k])) break;
            ooRexxClass.appendInheritance(new OORexxClass(words[k]));
        }
      }
     
      if(words[i].toLowerCase().equals("metaclass"))
        ooRexxClass.setMetaClass(new OORexxClass(words[i+1]));
     
    }
   
    if(ooRexxClass.getMetaClass() == null)
      ooRexxClass.setMetaClass(new OORexxClass("Class"));
   
    return ooRexxClass;
  }
View Full Code Here

TOP

Related Classes of org.oorexx.language.directive.OORexxClass

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.