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

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

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

Model.getDefault介绍

暂无

代码示例

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

public String getDefaultPackageName( boolean withVersion, Version version )
{
  String packageName = getDefault( ModelDefault.PACKAGE ).getValue();
  if ( withVersion )
  {
    packageName += "." + version.toString( "v", "_" );
  }
  return packageName;
}

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

protected void initialize( Model model, Properties parameters )
  throws ModelloException
{
  super.initialize( model, parameters );
  strictXmlAttributes = model.getDefault( ModelDefault.STRICT_XML_ATTRIBUTES ).getBoolean();
}

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

public String getPackageName( boolean withVersion, Version version )
{
  String p;
  if ( packageName != null )
  {
    p = packageName;
  }
  else
  {
    try
    {
      p = model.getDefault( ModelDefault.PACKAGE ).getValue();
    }
    catch ( Exception e )
    {
      p = ModelDefault.PACKAGE_VALUE;
    }
  }
  if ( withVersion )
  {
    p += "." + version.toString( "v", "_" );
  }
  return p;
}

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

private String getDefaultValue( ModelAssociation modelAssociation, JType componentType )
{
  String defaultValue = getDefaultValue( modelAssociation );
  if ( modelAssociation.isGenericType() )
  {
    ModelDefault modelDefault = getModel().getDefault( modelAssociation.getType() );
    if ( useJava5 )
    {
      defaultValue =
        StringUtils.replace( modelDefault.getValue(), "<?>", "<" + componentType.getName() + ">" );
    }
    else
    {
      defaultValue =
        StringUtils.replace( modelDefault.getValue(), "<?>", "/*<" + componentType.getName() + ">*/" );
    }
  }
  return defaultValue;
}

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

ModelDefault modelDefault = getModelClass().getModel().getDefault( ModelDefault.LIST );
    ModelDefault modelDefault = getModelClass().getModel().getDefault( getType() );

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

public void validateElement()
  throws ModelValidationException
{
  // Check if superClass exists
  if ( hasSuperClass() )
  {
    try
    {
      getModel().getClass( superClass, getVersionRange() );
      isInternalSuperClass = true;
    }
    catch ( ModelloRuntimeException e )
    {
      isInternalSuperClass = false;
    }
  }
  if ( getModel().getDefault( ModelDefault.CHECK_DEPRECATION ).getBoolean() )
  {
    if ( ! Version.INFINITE.equals( getVersionRange().getToVersion() )
       && getDeprecatedVersion() == null )
    {
      throw new ModelValidationException( "You must define the deprecated version of '" + getName() + "' class." );
    }
  }
}

相关文章