java_lang/tree/node/
import.rs1use std::{
2 borrow::Cow,
3 fmt::{Display, Formatter, Result as FmtResult},
4};
5
6#[derive(Debug)]
8pub enum ImportDeclaration<'a> {
9 SimpleType(Cow<'a, str>),
11 TypeOnDemand(Cow<'a, str>),
13 SingleStatic(Cow<'a, str>),
15 StaticOnDemand(Cow<'a, str>),
17}
18
19impl<'a> Display for ImportDeclaration<'a> {
20 fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
21 match self {
22 Self::SimpleType(r) | Self::SingleStatic(r) => write!(f, "import {};", r),
23 Self::TypeOnDemand(r) | Self::StaticOnDemand(r) => write!(f, "import {}.*;", r),
24 }
25 }
26}