@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; }
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; }
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; }
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; }
@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; }
@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; }
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; }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ @Override public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ @Override public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ @Override public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }
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; }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mNames); }