Api Java Uml

9 respostas
L

Existe alguma classe na api do java para gerar UML?

9 Respostas

Metaleiro

UML API

L

A documentação vai incluso no arquivo.zip?

L

Valeu, mas você tem algum código de exemplo?

Metaleiro

[color=darkblue]Tem essa opção também, exemplos eu não vou ter: [/color]

Novosoft UML Library for Java

fabiofalci

O que vc quer dizer com ‘gerar UML’?

Metaleiro

[color=darkblue] Segue o exemplo, espero que ajude :[/color]

UMLClassifierParser.java

package ru.novosoft.uml.notation;

import java.util.*;
import ru.novosoft.uml.foundation.core.*;
import ru.novosoft.uml.foundation.data_types.*;
import ru.novosoft.uml.foundation.extension_mechanisms.*;
import ru.novosoft.uml.behavior.common_behavior.*;
import ru.novosoft.uml.behavior.state_machines.*;
import ru.novosoft.uml.model_management.*;

public  abstract class UMLClassifierParser extends UMLFeatureParser
{
  public UMLClassifierParser(MNamespace ns, String str)
  {
    super(ns, str);
  }
  public final void parse()
  {
    parseStandardPart();
    ws();
    if(la('{'))
    {
      parseTagList();
    }
    ws();
    if (!eof())
      error("Unexpected characters");
  }
  final static UMLNotationUtil.Condition scond = new UMLNotationUtil.Condition()
  {
    public boolean check(MModelElement me)
    {
      if(!(me instanceof MStereotype))
        return false;
      // check base class here
      return true;
    }
  };
  /** called when stereotype is encontered */
  protected void stereotype(String s)
  {
    MStereotype st = (MStereotype)UMLNotationUtil.findElement(context, s, scond);
    if(st == null)
      error("stereotype "+s+" could not be found");
    stereotype(st);
  }
  
  protected void tag(String t)
  {//active for class
    //template
    if("leaf".equals(t))
      isLeaf();
    else if("root".equals(t))
      isRoot();
    else if("abstract".equals(t))
      isAbstract();
    else
      error("wrong tag: "+t);
  }
  protected void tag(String name,String value){
    //implementationLocation
    //isActive
    //isTemplate
    if("isLeaf".equals(name)||
       "isRoot".equals(name)||
       "isAbstract".equals(name))
    {
      if ("true".equals(value))
        tag(name.substring(2).toLowerCase());
      else if(!"false".equals(value))
        error("wrong value: "+value);
    }
    else
      error("wrong tag: "+name);
  }
  /** called when classifier scope flag is encountered */
  protected void classiferScope()
  {
    error("classifier scope flag cannot be in classifier definition");
  }
  protected abstract void stereotype(MStereotype s);
  protected abstract void isLeaf();
  protected abstract void isRoot();
  protected abstract void isAbstract();
}
L

Eu quero dizer fabiofalci, que a partir dos requisitos de um software eu poder gerar o diagrama de classe dele.

G

Olá, por acaso você conseguiu achar uma API boa pra gerar diagrama de classes em UML?

  • Gustavo
L

Olá, gumatias

As APIs citadas acima dá para fazer alguma coisa. Eu parei de mecher por causa das férias, mas em breve irei continuar a fazer esse projeto.

Criado 5 de maio de 2010
Ultima resposta 6 de set. de 2010
Respostas 9
Participantes 4