Java 类com.intellij.util.xml.Required 实例源码

项目:intellij-ce-playground    文件:MavenPluginConfigurationDomExtender.java   
private static void addRequiredAnnotation(DomExtension e, final ParameterData data) {
  if (Boolean.parseBoolean(data.parameter.getRequired().getStringValue())
      && StringUtil.isEmptyOrSpaces(data.defaultValue)
      && StringUtil.isEmptyOrSpaces(data.expression)) {
    e.addCustomAnnotation(new Required(){
      @Override
      public boolean value() {
        return true;
      }

      @Override
      public boolean nonEmpty() {
        return false;
      }

      @Override
      public boolean identifier() {
        return false;
      }
      public Class<? extends Annotation> annotationType() {
            return Required.class;
      }
    });
  }
}
项目:tools-idea    文件:MavenPluginConfigurationDomExtender.java   
private static void addRequiredAnnotation(DomExtension e, final ParameterData data) {
  if (Boolean.parseBoolean(data.parameter.getRequired().getStringValue())
      && StringUtil.isEmptyOrSpaces(data.defaultValue)
      && StringUtil.isEmptyOrSpaces(data.expression)) {
    e.addCustomAnnotation(new Required(){
      @Override
      public boolean value() {
        return true;
      }

      @Override
      public boolean nonEmpty() {
        return false;
      }

      @Override
      public boolean identifier() {
        return false;
      }
      public Class<? extends Annotation> annotationType() {
            return Required.class;
      }
    });
  }
}
项目:hybris-integration-intellij-idea-plugin    文件:Property.java   
/**
 * Returns the value of the name child.
 *
 * @return the value of the name child.
 */
@NotNull
@Required
//NOTE: We have to avoid @Convert since PsiField is in the read-only file and thus can't be renamed by platform
//NOTE: Instead we are renaming the attribute value itself, see BeansRenamePsiElementProcessor
//@Convert(soft = true, value = BeansPropertyNameConverter.class)
GenericAttributeValue<String> getName();
项目:intellij-ce-playground    文件:DomUIFactory.java   
@NotNull
private static BaseControl createGenericValueControl(final Type type, final GenericDomValue<?> element, boolean commitOnEveryChange) {
  final DomStringWrapper stringWrapper = new DomStringWrapper(element);
  final Class rawType = ReflectionUtil.getRawType(type);
  if (type instanceof Class && Enum.class.isAssignableFrom(rawType)) {
    return new ComboControl(stringWrapper, rawType);
  }
  if (DomElement.class.isAssignableFrom(rawType)) {
    final ComboControl control = new ComboControl(element);
    final Required annotation = element.getAnnotation(Required.class);
    if (annotation == null || !annotation.value() || !annotation.nonEmpty()) {
      control.setNullable(true);
    }
    return control;
  }

  final DomFixedWrapper wrapper = new DomFixedWrapper(element);
  if (type.equals(boolean.class) || type.equals(Boolean.class)) {
    return new BooleanControl(wrapper);
  }
  if (type.equals(String.class)) {
    return getDomUIFactory().createTextControl(wrapper, commitOnEveryChange);
  }

  final BaseControl customControl = getDomUIFactory().createCustomControl(type, stringWrapper, commitOnEveryChange);
  if (customControl != null) return customControl;

  return getDomUIFactory().createTextControl(stringWrapper, commitOnEveryChange);
}
项目:tools-idea    文件:DomUIFactory.java   
@NotNull
private static BaseControl createGenericValueControl(final Type type, final GenericDomValue<?> element, boolean commitOnEveryChange) {
  final DomStringWrapper stringWrapper = new DomStringWrapper(element);
  final Class rawType = ReflectionUtil.getRawType(type);
  if (type instanceof Class && Enum.class.isAssignableFrom(rawType)) {
    return new ComboControl(stringWrapper, rawType);
  }
  if (DomElement.class.isAssignableFrom(rawType)) {
    final ComboControl control = new ComboControl(element);
    final Required annotation = element.getAnnotation(Required.class);
    if (annotation == null || !annotation.value() || !annotation.nonEmpty()) {
      control.setNullable(true);
    }
    return control;
  }

  final DomFixedWrapper wrapper = new DomFixedWrapper(element);
  if (type.equals(boolean.class) || type.equals(Boolean.class)) {
    return new BooleanControl(wrapper);
  }
  if (type.equals(String.class)) {
    return getDomUIFactory().createTextControl(wrapper, commitOnEveryChange);
  }

  final BaseControl customControl = getDomUIFactory().createCustomControl(type, stringWrapper, commitOnEveryChange);
  if (customControl != null) return customControl;

  return getDomUIFactory().createTextControl(stringWrapper, commitOnEveryChange);
}
项目:consulo-xml    文件:DomUIFactory.java   
@NotNull
private static BaseControl createGenericValueControl(final Type type, final GenericDomValue<?> element, boolean commitOnEveryChange) {
  final DomStringWrapper stringWrapper = new DomStringWrapper(element);
  final Class rawType = ReflectionUtil.getRawType(type);
  if (type instanceof Class && Enum.class.isAssignableFrom(rawType)) {
    return new ComboControl(stringWrapper, rawType);
  }
  if (DomElement.class.isAssignableFrom(rawType)) {
    final ComboControl control = new ComboControl(element);
    final Required annotation = element.getAnnotation(Required.class);
    if (annotation == null || !annotation.value() || !annotation.nonEmpty()) {
      control.setNullable(true);
    }
    return control;
  }

  final DomFixedWrapper wrapper = new DomFixedWrapper(element);
  if (type.equals(boolean.class) || type.equals(Boolean.class)) {
    return new BooleanControl(wrapper);
  }
  if (type.equals(String.class)) {
    return getDomUIFactory().createTextControl(wrapper, commitOnEveryChange);
  }

  final BaseControl customControl = getDomUIFactory().createCustomControl(type, stringWrapper, commitOnEveryChange);
  if (customControl != null) return customControl;

  return getDomUIFactory().createTextControl(stringWrapper, commitOnEveryChange);
}
项目:intellij-ce-playground    文件:DomAttributeXmlDescriptor.java   
@Override
public boolean isRequired() {
  final Required required = myDescription.getAnnotation(Required.class);
  return required != null && required.value();
}
项目:intellij-ce-playground    文件:RngRef.java   
@NotNull
@Required
@Referencing(RngReferenceConverter.class)
GenericAttributeValue<String> getName();
项目:intellij-ce-playground    文件:RngInclude.java   
/**
 * Returns the value of the href child.
 *
 * @return the value of the href child.
 */
@NotNull
@Required
@Convert(RngHrefConverter.class)
@com.intellij.util.xml.Attribute("href")
GenericAttributeValue<XmlFile> getIncludedFile();
项目:intellij-ce-playground    文件:RngExternalRef.java   
/**
 * Returns the value of the href child.
 *
 * @return the value of the href child.
 */
@NotNull
@Required
@Convert(RngHrefConverter.class)
@com.intellij.util.xml.Attribute("href")
GenericAttributeValue<XmlFile> getReferencedFile();
项目:intellij-ce-playground    文件:Style.java   
@Override
@Required
@Convert(ResourceNameConverter.class)
GenericAttributeValue<String> getName();
项目:intellij-ce-playground    文件:ResourceElement.java   
@Required
@Convert(ResourceNameConverter.class)
GenericAttributeValue<String> getName();
项目:intellij-ce-playground    文件:PluralsItem.java   
@Convert(QuantityConverter.class)
@Required
GenericAttributeValue<String> getQuantity();
项目:intellij-ce-playground    文件:ManifestElementWithRequiredName.java   
@Required
AndroidAttributeValue<String> getName();
项目:intellij-ce-playground    文件:Instrumentation.java   
@Attribute("name")
@Required
@Convert(PackageClassConverter.class)
@CompleteNonModuleClass
@ExtendClass(AndroidUtils.INSTRUMENTATION_RUNNER_BASE_CLASS)
AndroidAttributeValue<PsiClass> getInstrumentationClass();
项目:intellij-ce-playground    文件:Instrumentation.java   
@Required
@Attribute("targetPackage")
@Convert(InstrumentationTargetPackageConverter.class)
AndroidAttributeValue<String> getTargetPackage();
项目:intellij-ce-playground    文件:Activity.java   
@Attribute("name")
@Required
@Convert(PackageClassConverter.class)
@ExtendClass("android.app.Activity")
AndroidAttributeValue<PsiClass> getActivityClass();
项目:intellij-ce-playground    文件:ActivityAlias.java   
@Required
@Convert(value = PackageClassConverter.class)
@ExtendClass("android.app.Activity")
@Attribute("targetActivity")
AndroidAttributeValue<PsiClass> getTargetActivity();
项目:intellij-ce-playground    文件:UsesPermission.java   
@Attribute("name")
@Required
@Convert(ConstantFieldConverter.class)
@LookupClass("android.Manifest.permission")
@LookupPrefix("android.permission")
AndroidAttributeValue<String> getName();
项目:intellij-ce-playground    文件:TransitionManager.java   
@Attribute("toScene")
@Convert(ResourceReferenceConverter.class)
@Required
@AndroidResourceType("layout")
AndroidAttributeValue<ResourceValue> getToScene();
项目:intellij-ce-playground    文件:ColorDrawable.java   
@Convert(ResourceReferenceConverter.class)
@AndroidResourceType("color")
@Required
AndroidAttributeValue<ResourceValue> getColor();
项目:intellij-ce-playground    文件:AnimatedStateListTransition.java   
@Convert(ResourceReferenceConverter.class)
@AndroidResourceType("id")
@Attribute("fromId") // without this it's interpreted as "from-id"
@Required
AndroidAttributeValue<ResourceValue> getFromId();
项目:intellij-ce-playground    文件:AnimatedStateListTransition.java   
@Convert(ResourceReferenceConverter.class)
@AndroidResourceType("id")
@Attribute("toId") // without this it's interpreted as "to-id"
@Required
AndroidAttributeValue<ResourceValue> getToId();
项目:intellij-ce-playground    文件:AnimatedVector.java   
@Convert(ResourceReferenceConverter.class)
@AndroidResourceType("drawable")
@Required
AndroidAttributeValue<ResourceValue> getDrawable();
项目:intellij-ce-playground    文件:Ripple.java   
@Convert(ResourceReferenceConverter.class)
@AndroidResourceType("color")
@Attribute("color")
@Required
AndroidAttributeValue<ResourceValue> getColor();
项目:intellij-ce-playground    文件:BitmapOrNinePatchElement.java   
@Required
@Convert(ResourceReferenceConverter.class)
@AndroidResourceType("drawable")
AndroidAttributeValue<String> getSrc();
项目:intellij-ce-playground    文件:AnimatedVectorTarget.java   
@Required
AndroidAttributeValue<String> getName();
项目:intellij-ce-playground    文件:AnimatedVectorTarget.java   
@Convert(ResourceReferenceConverter.class)
@Required
@AndroidResourceType("anim")
AndroidAttributeValue<ResourceValue> getAnimation();
项目:intellij-ce-playground    文件:Extra.java   
@Required
AndroidAttributeValue<String> getName();
项目:intellij-ce-playground    文件:Extra.java   
@Required
AndroidAttributeValue<String> getValue();
项目:intellij-ce-playground    文件:ColorStateListItem.java   
@Convert(ResourceReferenceConverter.class)
@AndroidResourceType("color")
@Required
AndroidAttributeValue<ResourceValue> getColor();
项目:intellij-ce-playground    文件:Tag.java   
@Required
@AndroidResourceType("id")
@Convert(ResourceReferenceConverter.class)
AndroidAttributeValue<ResourceValue> getId();
项目:intellij-ce-playground    文件:MavenDomDistributionManagement.java   
@NotNull
@Required(value = false, nonEmpty = true)
@Convert(MavenDistributionStatusConverter.class)
GenericDomValue<String> getStatus();
项目:intellij-ce-playground    文件:MavenDomRepositoryBase.java   
@NotNull
@Required
@Convert(MavenRepositoryConverter.Id.class)
GenericDomValue<String> getId();
项目:intellij-ce-playground    文件:MavenDomRepositoryBase.java   
@NotNull
@Required(value = false, nonEmpty = true)
@Convert(MavenRepositoryLayoutConverter.class)
GenericDomValue<String> getLayout();
项目:intellij-ce-playground    文件:MavenDomShortArtifactCoordinates.java   
@Required
@NoSpellchecking
@Convert(MavenArtifactCoordinatesGroupIdConverter.class)
GenericDomValue<String> getGroupId();
项目:intellij-ce-playground    文件:MavenDomShortArtifactCoordinates.java   
@Required
@NoSpellchecking
@Convert(MavenArtifactCoordinatesArtifactIdConverter.class)
GenericDomValue<String> getArtifactId();
项目:intellij-ce-playground    文件:MavenDomPlugin.java   
@Required(value = false, nonEmpty = true)
GenericDomValue<String> getGroupId();
项目:intellij-ce-playground    文件:MavenDomPlugin.java   
@Required(value = false, nonEmpty = true)
GenericDomValue<String> getVersion();
项目:intellij-ce-playground    文件:MavenDomExtension.java   
@Required(value = false, nonEmpty = true)
GenericDomValue<String> getGroupId();