org.codehaus.modello.model.Model.getClasses()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.codehaus.modello.model.Model.getClasses()方法的一些代码示例,展示了Model.getClasses()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.getClasses()方法的具体详情如下:
包路径:org.codehaus.modello.model.Model
类名称:Model
方法名:getClasses

Model.getClasses介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.modello/modello-plugin-java

protected List<ModelClass> getClasses( Model model )
{
  List<ModelClass> modelClasses = new ArrayList<ModelClass>();
  for ( ModelClass modelClass : model.getClasses( getGeneratedVersion() ) )
  {
    if ( isRelevant( modelClass ) )
    {
      modelClasses.add( modelClass );
    }
  }
  return modelClasses;
}

代码示例来源:origin: org.codehaus.modello/modello-plugin-store

protected static Context makeStubVelocityContext( Model model, Version version, String packageName )
{
  List classes = model.getClasses( version );
  Map classFields = new HashMap();
  for ( Iterator it = classes.iterator(); it.hasNext(); )
  {
    ModelClass modelClass = (ModelClass) it.next();
    List fields = modelClass.getFields( version );
    classFields.put( modelClass.getName(), fields );
  }
  Context context = new VelocityContext();
  context.put( "version", version );
  context.put( "model", model );
  context.put( "classes", classes );
  context.put( "classFields", classFields );
  context.put( "javaTool", new JavaTool() );
  context.put( "package", packageName );
  return context;
}

代码示例来源:origin: org.apache.archiva.redback.components.modello/modello-plugin-store

protected static Context makeStubVelocityContext( Model model, Version version, String packageName )
{
  List classes = model.getClasses( version );
  Map classFields = new HashMap();
  for ( Iterator it = classes.iterator(); it.hasNext(); )
  {
    ModelClass modelClass = (ModelClass) it.next();
    List fields = modelClass.getFields( version );
    classFields.put( modelClass.getName(), fields );
  }
  Context context = new VelocityContext();
  context.put( "version", version );
  context.put( "model", model );
  context.put( "classes", classes );
  context.put( "classFields", classFields );
  context.put( "javaTool", new JavaTool() );
  context.put( "package", packageName );
  return context;
}

代码示例来源:origin: org.codehaus.modello/modello-plugin-jpox

for ( Iterator it = model.getClasses( getGeneratedVersion() ).iterator(); it.hasNext(); )

代码示例来源:origin: org.apache.archiva.redback.components.modello/modello-plugin-jpox

for ( Iterator it = model.getClasses( getGeneratedVersion() ).iterator(); it.hasNext(); )

代码示例来源:origin: org.codehaus.modello/modello-core

public ModelClass getSourceTracker( Version version )
{
  List<ModelClass> modelClasses = getClasses( version );
  ModelClass sourceTracker = null;
  for ( ModelClass modelClass : modelClasses )
  {
    ModelClassMetadata metadata = (ModelClassMetadata) modelClass.getMetadata( ModelClassMetadata.ID );
    if ( metadata != null && StringUtils.isNotEmpty( metadata.getSourceTracker() ) )
    {
      if ( sourceTracker == null )
      {
        sourceTracker = modelClass;
      }
      else
      {
        throw new ModelloRuntimeException(
          "There are multiple source tracker classes (" + sourceTracker.getName() + " vs. "
            + modelClass.getName() + ") for this version " + version + "." );
      }
    }
  }
  return sourceTracker;
}

代码示例来源:origin: org.codehaus.modello/modello-plugin-stax

protected boolean isAssociationPartToClass( ModelClass modelClass )
  {
    if ( parts == null )
    {
      parts = new HashSet<ModelClass>();
      for ( ModelClass clazz : modelClass.getModel().getClasses( getGeneratedVersion() ) )
      {
        for ( ModelField modelField : clazz.getFields( getGeneratedVersion() ) )
        {
          if ( modelField instanceof ModelAssociation )
          {
            ModelAssociation assoc = (ModelAssociation) modelField;

            XmlAssociationMetadata xmlAssocMetadata =
              (XmlAssociationMetadata) assoc.getAssociationMetadata( XmlAssociationMetadata.ID );

            if ( xmlAssocMetadata.isReference() )
            {
              parts.add( assoc.getToClass() );
            }
          }
        }
      }
    }
    return parts.contains( modelClass );
  }
}

代码示例来源:origin: org.codehaus.modello/modello-core

public ModelClass getLocationTracker( Version version )
{
  List<ModelClass> modelClasses = getClasses( version );
  ModelClass locationTracker = null;
  for ( ModelClass modelClass : modelClasses )
  {
    ModelClassMetadata metadata = (ModelClassMetadata) modelClass.getMetadata( ModelClassMetadata.ID );
    if ( metadata != null && StringUtils.isNotEmpty( metadata.getLocationTracker() ) )
    {
      if ( locationTracker == null )
      {
        locationTracker = modelClass;
      }
      else
      {
        throw new ModelloRuntimeException(
          "There are multiple location tracker classes (" + locationTracker.getName() + " vs. "
            + modelClass.getName() + ") for this version " + version + "." );
      }
    }
  }
  return locationTracker;
}

代码示例来源:origin: org.codehaus.modello/modello-core

public String getRoot( Version version )
  List<ModelClass> classes = getClasses( version );

代码示例来源:origin: org.codehaus.modello/modello-plugin-xsd

int initialCapacity = objectModel.getClasses( getGeneratedVersion() ).size();
writeComplexTypeDescriptor( w, objectModel, root, new HashSet<ModelClass>( initialCapacity ) );

代码示例来源:origin: org.codehaus.modello/modello-plugin-java

for ( ModelClass modelClass : objectModel.getClasses( getGeneratedVersion() ) )

代码示例来源:origin: org.codehaus.modello/modello-plugin-converters

for ( ModelClass modelClass : objectModel.getClasses( fromVersion ) )

相关文章