public static ChoiceContentSpec constructChoice(boolean nsAware, char arity, Collection specs) { return new ChoiceContentSpec(nsAware, arity, false, specs); }
public StructValidator getSimpleValidator() { /* Can we create a simple validator? Yes, if the sub-specs are * all simple (leaves == element tokens with no arity modifier); * this is always true for mixed. */ ContentSpec[] specs = mContentSpecs; int len = specs.length; int i; if (mHasMixed) { i = len; } else { i = 0; for (; i < len; ++i) { if (!specs[i].isLeaf()) { break; } } } if (i == len) { // all leaves, kewl PrefixedNameSet keyset = namesetFromSpecs(mNsAware, specs); return new Validator(mArity, keyset); } // Nah, need a DFA... return null; }
return EmptyValidator.getPcdataInstance(); ContentSpec spec = ChoiceContentSpec.constructMixed(mCfgNsEnabled, m.values()); StructValidator val = spec.getSimpleValidator(); if (val == null) {
return ChoiceContentSpec.constructChoice(mCfgNsEnabled, arity, subSpecs);
return EmptyValidator.getPcdataInstance(); ContentSpec spec = ChoiceContentSpec.constructMixed(mCfgNsEnabled, m.values()); StructValidator val = spec.getSimpleValidator(); if (val == null) {
return ChoiceContentSpec.constructChoice(mCfgNsEnabled, arity, subSpecs);
public static ChoiceContentSpec constructMixed(boolean nsAware, Collection specs) { return new ChoiceContentSpec(nsAware, '*', true, specs); }
public StructValidator getSimpleValidator() { /* Can we create a simple validator? Yes, if the sub-specs are * all simple (leaves == element tokens with no arity modifier); * this is always true for mixed. */ ContentSpec[] specs = mContentSpecs; int len = specs.length; int i; if (mHasMixed) { i = len; } else { i = 0; for (; i < len; ++i) { if (!specs[i].isLeaf()) { break; } } } if (i == len) { // all leaves, kewl NameKeySet keyset = namesetFromSpecs(mNsAware, specs); return new Validator(mArity, keyset); } // Nah, need a DFA... return null; }
return EmptyValidator.getPcdataInstance(); ContentSpec spec = ChoiceContentSpec.constructMixed(mCfgNsEnabled, m.values()); StructValidator val = spec.getSimpleValidator(); if (val == null) {
return ChoiceContentSpec.constructChoice(mCfgNsEnabled, arity, subSpecs);
public static ChoiceContentSpec constructChoice(boolean nsAware, char arity, Collection<ContentSpec> specs) { return new ChoiceContentSpec(nsAware, arity, false, specs); }
@Override public StructValidator getSimpleValidator() { /* Can we create a simple validator? Yes, if the sub-specs are * all simple (leaves == element tokens with no arity modifier); * this is always true for mixed. */ ContentSpec[] specs = mContentSpecs; int len = specs.length; int i; if (mHasMixed) { i = len; } else { i = 0; for (; i < len; ++i) { if (!specs[i].isLeaf()) { break; } } } if (i == len) { // all leaves, kewl PrefixedNameSet keyset = namesetFromSpecs(mNsAware, specs); return new Validator(mArity, keyset); } // Nah, need a DFA... return null; }
return EmptyValidator.getPcdataInstance(); ContentSpec spec = ChoiceContentSpec.constructMixed(mCfgNsEnabled, m.values()); StructValidator val = spec.getSimpleValidator(); if (val == null) {
return ChoiceContentSpec.constructChoice(mCfgNsEnabled, arity, subSpecs);
public static ChoiceContentSpec constructChoice(boolean nsAware, char arity, Collection specs) { return new ChoiceContentSpec(nsAware, arity, false, specs); }
public StructValidator getSimpleValidator() { /* Can we create a simple validator? Yes, if the sub-specs are * all simple (leaves == element tokens with no arity modifier); * this is always true for mixed. */ ContentSpec[] specs = mContentSpecs; int len = specs.length; int i; if (mHasMixed) { i = len; } else { i = 0; for (; i < len; ++i) { if (!specs[i].isLeaf()) { break; } } } if (i == len) { // all leaves, kewl NameKeySet keyset = namesetFromSpecs(mNsAware, specs); return new Validator(mArity, keyset); } // Nah, need a DFA... return null; }
return EmptyValidator.getPcdataInstance(); ContentSpec spec = ChoiceContentSpec.constructMixed(mCfgNsEnabled, m.values()); StructValidator val = spec.getSimpleValidator(); if (val == null) {
return ChoiceContentSpec.constructChoice(mCfgNsEnabled, arity, subSpecs);
public static ChoiceContentSpec constructChoice(boolean nsAware, char arity, Collection specs) { return new ChoiceContentSpec(nsAware, arity, false, specs); }
@Override public StructValidator getSimpleValidator() { /* Can we create a simple validator? Yes, if the sub-specs are * all simple (leaves == element tokens with no arity modifier); * this is always true for mixed. */ ContentSpec[] specs = mContentSpecs; int len = specs.length; int i; if (mHasMixed) { i = len; } else { i = 0; for (; i < len; ++i) { if (!specs[i].isLeaf()) { break; } } } if (i == len) { // all leaves, kewl PrefixedNameSet keyset = namesetFromSpecs(mNsAware, specs); return new Validator(mArity, keyset); } // Nah, need a DFA... return null; }